Multi core mayhem

Gabe Newell of HL2 fame has been whining about the next gen consoles. I agree with him: multi processor hard, as I said in a previous post.

When I was trying to think of threads for a game I came up with display, logic and input. The Xbox 360 has 3 cores. Ain't no way that 1 core needs to do input. So efficient use is going to require another approach. Splitting it further I guess you could put the physics calcs on another core, but that becomes harder. All of a sudden physics is likely to have race conditions with the logic.

Ideally you require the balance to grow evenly on each core. No point in having one maxed and the other two idle. This points towards a bizzare splitting of logic, display and processing. I guess one approach is to try and split to as many threads as possible: 1 network, 1 input, 1 logic, 1 ai, 1 physics, 1 display foreground, 1 display background. This would allow the kernel to try and balance the load. The really tricky one is the multi display and logic threads. Race conditions will be everywhere. I suspect the latest GPUs leave the processor actually quite idle during the average render, so it may be only the logic that can be usefully split.

Now imagine writing a routine to bounce a ball, and having another routine adding hitting it with bat. You are going to have to lock the balls details, add the hit and then let the physics take back over. That is a lot of synchronization for a very simple problem. Developing these processes for every game is going to be hard.

I suspect libraries are the only sensible way to deal with the problem. The trouble is they are very thin on the ground considering how close these toys are from release. The AEGIS PPU has a multithreaded physics library. That could be a starting point, but my predition is the next gen consoles will take a lot longer than previous gens to exploit. In fact if the cores are not much quicker than the old gen it may be somewhat disappointing how little they improve. HDTV doesn't do it for me -my eyes sadly are too bad to fully appreciate it, and the cost of it precludes it from my living room.

I am also concerned that libraries will lead to lots of similar feeling games - much like the Doom-a-likes that filled the 90s.

I also read that the PS3 may be delayed. I wonder if this is related in part to the late choosing of NVidia as GPU provider. I have never seen a PS2 dev kit, but I hear they were quite rudimentary. I wonder if Sony are going to invest in better dev tools this time round. The delay could play into their hands as it would give them breathing space to produce some of the libraries required to get more from their console. If they do not have them ready for release the headstart the XBox gets - while programmers learn the ropes - may become a higher mountain to climb than people realize...

Comments

Popular Posts