blakjedi said:Three symmetrical cores... if you can program (threads) for one you can do it for all...
is it switching moving instructions from one thread to another?
Help me understand... it seems like a no brainer... BTW has anyone ever seen the Xenon?
Alstrong said:Before the alpha kits went out, is JC the only one who has even attempted multithreaded code in a game engine (commercial release, not just for internal testing purposes)?
ERP said:Multithreading is a common tool in game engines to make operations asynchronous. The difference is that on platforms with multiple cores you are trying to balance workload, not just hide operation latencies.
Multithreaded code is difficult to get right, and can be hideous to debug with large numbers of threads. They are also extremly difficult to test, since man of the possible bugs are timing related.
blakjedi said:Three symmetrical cores... if you can program (threads) for one you can do it for all...
is it switching moving instructions from one thread to another?
Help me understand... it seems like a no brainer... BTW has anyone ever seen the Xenon?
Java_man said:Well it would have been easier to program if there was a multithread friendly language such as Java for early games developpement.
You cannot multithread the outer loop of your game but for a few minor things (like ambient sound and effects playback). Unless you want rendering to lag behind physics for a frame, you can't run physics and "geometry" in parallel. Physics tells you where everything is... AI tells you where the bots are. The rather nebulous term of "game code" will include telling you about positions of player, camera, what animations will be playing, sound/graphical effects that should be triggered at some point, messages passed around from object to object and machine to machine.MS' console diagram made it look so conceptually easy.
Essentially I think of it as
Processor 0/Thread 0 (P0/T0) equals game code,
P0/T1 equals AI
P1/T0 equals physics
P1/T1 equals geometry
P2/T0 equals sound
P2/T1 equals extra....
ShootMyMonkey said:You cannot multithread the outer loop of your game but for a few minor things (like ambient sound and effects playback). Unless you want rendering to lag behind physics for a frame, you can't run physics and "geometry" in parallel. Physics tells you where everything is... AI tells you where the bots are. The rather nebulous term of "game code" will include telling you about positions of player, camera, what animations will be playing, sound/graphical effects that should be triggered at some point, messages passed around from object to object and machine to machine.
If you are all right with letting certain computations lag behind others, you have to be sure to buffer off several copies of world states. Object transforms, bounding boxes, no big deal. Bone transforms of each and every skinned object... ha... And if anything, accessing memory on Xenon can be considered a capital offense punishable by 13 forms of torture.
darkblu said:just a remark on that treads load distribution - due to the 'hyperthreading' nature of those cores you'd want to pair time-critical with non-time-citical threads (or non-citical with non-critical), so that the lower priority thread wouldn't get into the way of the higher priority thread while smt-ing. actually the more critical one of those threads is the greater the difference in priorities you want. you may also want to consider memory access patters across the threads running on a single core and make sure they play nice to each other's caches.
ERP said:My theory on this is you want to pair the same work on both threads. i.e. Say have two vertex transform threads on one CPU. That way you get the best possible cache coherence and you use up some of the cycles lost ton instruction and memory latency.
Well, I also picture CELL being used in a pretty similar way to VUs. Namely that you'll multithread off the individual independent repetitive tasks like skinning verts or performing line-of-sight tests. In essence, while it's not impossible to do things like make AI independent of physics (for the current frame, anyway), it's a lot easier to find individual things within the loop that can be multithreaded, than to adjust the design on a larger scale.As far as multi-threaded game engines go, don't forget that basically all PS2 games are multi-threaded (EE has three processor cores). The better Saturn games were multi-threaded too (Saturn had two CPUs). Compared to either of those examples programming X360 games will be simple!
Dungeon Siege increased in performance with 2 slow CPUs. In my case I had 2 P3 733's and there wasn't a huge performance increase, but there was an increase. Most importantly the minimum frame rate was increased.Alstrong said:I meant in games where we would actually see performance increases by having more than one processor... It was demonstrated in Quake III, but I haven't seen any other game in the same situation...