Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

game threads

1 view
Skip to first unread message

b...@coolgroups.com

unread,
Feb 10, 2006, 4:03:05 AM2/10/06
to
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.

Joe Seigh

unread,
Feb 10, 2006, 7:39:10 AM2/10/06
to
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
patterns.

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
before.

--
Joe Seigh

When you get lemons, you make lemonade.
When you get hardware, you make software.

Phil Frisbie, Jr.

unread,
Feb 10, 2006, 12:05:38 PM2/10/06
to
b...@coolgroups.com wrote:

Two main areas I have seen: network communications and resource loading.

On the network side it is important when using UDP to receive UDP message as
quickly as possible so that the OS receive buffer does not fill up and discard
messages.

But resource loading is a REALLY big deal. Think about this: would you wait 60+
seconds to load a game level while ALL textures and objects were loaded from
disk to memory? That is why most games quickly load just what you will see the
first few seconds of the game, and use a low priority thread to load more
textures and objects so they are ready when needed.

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com

Doug

unread,
Feb 10, 2006, 2:44:09 PM2/10/06
to
Some of the new 360 games run a continuous AI thread on one of the
cores. Some also use another for streaming (though that's really just
convenience).

b...@coolgroups.com

unread,
Feb 10, 2006, 2:44:31 PM2/10/06
to
Thanks for the tips.

On a similar note, what's the difference between a lock and a semaphore?

Ulrich Eckhardt

unread,
Feb 12, 2006, 4:20:07 AM2/12/06
to
b...@coolgroups.com wrote:
> Can someone tell me when you would need to use threads in programming a
> game?

Playing music?

Uli

Doug

unread,
Feb 12, 2006, 6:13:46 AM2/12/06
to

Markus Elfring

unread,
Feb 12, 2006, 4:01:50 PM2/12/06
to

Did you read the previous discussion "Rise of the multicore machines"?

Regards,
Markus


0 new messages