> Can someone tell me when you would need to use threads in programming a
> game? I've written a few games, and I've never needed them, but these
> game development companies acted like they were real important when I
> talked to them.
For performance gains by being able to exploit multiprocessors.
On the client side (the PC) it will depend on how well a formerly single
threaded application can be parallelized or decomposed into other threaded
On the server side (also the PC if you're peer to peer) for multi-player
game the usual server multi-threading tricks to handle multiple simultaneous
requests from client machines. With network latency a factor, I'd say
protocol design was important also given this is an area cheats occur in.
The protocol issues overlap with thread design semantics somewhat.
So the game companies think threading is important? Well given that they
want game programming skills first and foremost, and threading as a
secondary skill set, they're pretty much guaranteed not to get any threading
experts. They'll be happy to get competency in rudimentary threading. The
typical questions they might ask is "what's the difference between a lock
and a semaphore?" and "how do you avoid deadlock?". They also might ask
if you are good at debugging multi-threaded programs. While that's a
legitimate question, if they actually ask it what they're really saying
is their code clobbers shared structures and nobody is good at debugging
those. Just lie and say yes if you've debugged any multi-threaded code
When you get lemons, you make lemonade.
When you get hardware, you make software.