Original Post
So I'm going through the prelimenary process of laying out the design for my next game project, and one of the major design goals I had was for this to be multithreaded in some capacity. Mostly because that's an area of programming I don't have much experience in yet (and want to have) and partly because it seems to be the wave of the future. Anyway, the real question here is what parts of a typical computer game (well, 3D in this case if it matters) are suitable to being multithreaded? I'm sure there are tons of possibilities, but I'm not coming up with much by myself. I can see a lot of merit in using extra threads to keep up with things like networking and file loading, but that's not the sort of thing I'm looking to multithread here. For one, this game won't have networking at all, and file loading is a sort of static thing in this game (i.e. happens all at start up, no dynamic loading of the world or anything). Other than that, what potential is there for multithreading? The only big thing I can think up that really seems appropriate would be updating the scene. You could traverse the scene graph and hand out objects that you come across to the CPUs in some sort of scheduling manner so that the work load is divided up. I've read that this is really a bad idea though since there are so many interdependencies between objects that memory locking causes you to pretty much loose any benefit and causes the code to be much harder to make. I think that can be circumvented though through a few different methods. Maybe compute what the next frame should be, store that data separately, then after all updating is done go back through and copy that data to the new 'current' frame. Something like that maybe... that way you don't have to fight to access otherwise volatile memory and with enough cores it should have some improvement over just doing it serially. My guess is that if it were that easy though, modern games would do it, and so I ask what sort of other things in a modern game can be divided up? I can also see a lot of point in doing things like physics asynchronously from the real frame rate and using extra CPUs, or doing animation (but isn't that usually off loaded to the GPU now anyway?). Any other ideas? I've got an 8 core computer here (not that that's why I built it mind you) and I'd like to put some of that to use.