Pages: 1 2 [3] 4
  Print  
Author Topic: I'm bookmarking this day  (Read 10031 times)
Offline (Female) IsmAvatar
Reply #30 Posted on: September 17, 2009, 02:14:55 PM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
I can't imagine how threading AI would be useful. Practically everything but the input is dependent on the results of the AI.
Logged
Offline (Male) Josh @ Dreamland
Reply #31 Posted on: September 17, 2009, 02:58:41 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2955

View Profile Email
I can see threading a pathfinding script, as long as you didn't constantly need the entire path.
If it was optimized for threading, especially. Optimized in the sense that it can put multiple pieces together, including fixing the beginning and end of the path where the points may have moved during processing.

With things like threading, you'll lose the general-purpose functionality you get from simpler scripting, but ideally with a great speed gain.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) luiscubal
Reply #32 Posted on: September 17, 2009, 04:46:46 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
I was just exemplifying how many cores could be used.

Also, here's a possible AI function:

var whatever = new BehaviorThread();
whatever.start();
//Do something
whatever.waitUntilThatThreadFinishes();
var result = whatever.result;
//Do something with result

As you can see, if I *know* I'm going to need the value of "result" in the future, why not put it in a separated thread and ask the result later(in the scenario of having an "unlimited" number of cores)?
Logged
Offline (Male) RetroX
Reply #33 Posted on: September 17, 2009, 05:22:54 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Wow, why did I read that as CPU. :/

Anyways, threads are useful.  For doing multiple things at once.  Windows uses a thread for each application.  A single thread for the OS is not one thread; it is many.  It would make sense to use threads to run things in threads for speed, wait for all threads to finish, whereas if the threads do not finish within x time, it's considered too much lag and an error pops up.  All of this is controlled from a separate thread.

why did everyone ninja me

doesn't SMF have an anti-ninja feature

oh, paged, stupid
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #34 Posted on: September 17, 2009, 06:22:38 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Windows usually has several threads for each application, even. Right now, Firefox is running with 20 threads, explorer with 11, pidgin with 5... Even if you never need more than a few threads for each application (which in the future will probably change), having more cores would still be nice because applications could use separate cores rather than sharing one or two.
Logged
Offline (Male) RetroX
Reply #35 Posted on: September 17, 2009, 07:05:55 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
That's the programs making the threads, not Windows. :/

And yes, it is.  However, it's nice to have threads split across cores, and normally, they do not.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #36 Posted on: September 18, 2009, 10:47:15 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
I know that, silly. I just used the same language as you did with "Windows uses a thread for each application."
Logged
Offline (Unknown gender) Game_boy
Reply #37 Posted on: September 18, 2009, 11:34:11 AM
Member
Joined: Apr 2008
Posts: 228

View Profile
That's the programs making the threads, not Windows. :/

And yes, it is.  However, it's nice to have threads split across cores, and normally, they do not.

Is that because they can't? Are there two kinds of threads or something?
Logged
Offline (Unknown gender) luiscubal
Reply #38 Posted on: September 18, 2009, 01:46:19 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
Look. You can only split threads across cores if there *ARE* multiple threads to split.
That's one of the modern programming challenges. Multi-cores are coming and many applications are single-threaded.Even if there are a few *processes* split across different cores, typically you can find that only one of those processes is doing really hard work. When that process has only one thread - which is more common than it should be - you often end up with a core at 100% and the other(s) at 1%/2%.
Logged
Offline (Male) RetroX
Reply #39 Posted on: September 18, 2009, 02:33:54 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Thing is, you need the application to do the splitting.  Windows won't and shouldn't split the threads itself; that way, a game can split to one core and all applications can split to one, etc.  For example, you should assign each core a name and task - for example, one is a "game" core, one is a "utility" core, etc.  The OS should decide which core the thread should go to depending on the cores' activity, the requested core, and the resources required by the thread, merging and freeing certain cores according to required tasks, so the most is always used out of the cores.  Obviously, that isn't happening right now.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) Game_boy
Reply #40 Posted on: September 18, 2009, 02:55:20 PM
Member
Joined: Apr 2008
Posts: 228

View Profile
Look. You can only split threads across cores if there *ARE* multiple threads to split.

I know that, I was just thrown by the wording.
Logged
Offline (Unknown gender) Micah
Reply #41 Posted on: September 18, 2009, 04:41:48 PM

Resident Troll
Joined: May 2008
Posts: 129

View Profile
Quote from: RetroX
The OS should decide which core the thread should go to depending on the cores' activity, the requested core, and the resources required by the thread, merging and freeing certain cores according to required tasks, so the most is always used out of the cores.
Sounds like Grand Central Dispatch. It's a new feature in Snow Leopard.
Logged
Offline (Male) RetroX
Reply #42 Posted on: September 18, 2009, 08:14:23 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Sounds like Grand Central Dispatch. It's a new feature in Snow Leopard.
It is?  Well, thumbs up for Apple.  Maybe Linux will do something like this in kernel 27 or something, if they think of making it.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) Game_boy
Reply #43 Posted on: September 19, 2009, 03:41:07 AM
Member
Joined: Apr 2008
Posts: 228

View Profile
Great explanation of GCD:

http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/12
http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/13

Too bad the license is incompatible with the Linux kernel.

Logged
Offline (Male) RetroX
Reply #44 Posted on: September 19, 2009, 07:16:22 AM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
I meant something like it, not taking the code.  Unless Apple was a jerk and patented it or something, which I doubt.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Pages: 1 2 [3] 4
  Print