What is the best way to exploit multicores when making multithread games?

Posted by Keeper on Game Development See other posts from Game Development or by Keeper
Published on 2012-03-16T13:00:16Z Indexed on 2012/03/28 17:46 UTC
Read the original article Hit count: 217

Filed under:

Many people suggest to write a program, and then start optimizing it. But I think that when it's coming to multithreading with multicore, a little think ahead is required.
I've read about using threads, and experienced it myself during some courses at the university (still a student).

The big question is simple, but a bit abstract:

What thread related steps in game design do I need to take, before implementation?

Now trying to be more specific. Let's say, as an example, that I'm making a small board game (like Monopoly) that I want to be multithreaded.
My goal Is that this multithreaded game will exploit the best of the multicore system, lets say 4-6 cores (like in i7 processors).

My answer to this question at the moment is, one thread for each of these four basic components:

  • GUI
  • User Input / Output
  • AI (computer rival)
  • Other game related calculations (like shortest path from A to B, or level up status change)

I'm not an expert (yet!), and I'm sure there are better answers out there.
Any suggestion, answer, different approach will be helpful.

Some thoughts:
Maybe splitting the main database is a good way.. (or total disaster.. )

© Game Development or respective owner

Related posts about multithreading