How freely do you use multithreading in your games?

Started by
31 comments, last by Halsafar 18 years, 9 months ago
I like using multiple threads for ease of programming more than anything else. As long as you have a solid engine design that doesn't require a lot of mutexes to protect critical areas then it actaully is a lot easier to debug stuff since it's contained in a particular thread. You don't have to worry about sifting through a whole bunch of code game logic code that may or may not be affecting your renderer. Performance gains on multi-core systems are just a bonus for right now. But at least once everyone starts running multi-core I'll already have that bonus built in.
Advertisement
on my notebook, an older p4-M, i implemented basic threading in my pathtracer, to later have support for multicpusystems (and for a network of computers..). interestingly, i get the highest performing result, if i render with 64 (!!!) threads in parallel.

reason has to be memory and cache failures. it looks like it skips the thread and goes to the next when-ever the cpu flushes its pipe, and when ever memory gets accessed (or just one or the other :D).

well, it's an old p4, wich has a lot of performance-drops due to its much-too-long pipe :D

it's an app completely written in c#. i'm impressed, i got a 2x speedup just by implementing threading.

actually, it now renders about as fast as my 2gig athlon64 !! looks like both cpu's now get to about 100% usage.

the athlon64 is just SO MUCH BETHER at not stalling all the time :D
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Did everyone skip my small post near beginning.
I posted a nice article which overlays a rather extreme use of threads for a large performance increase.


Threads are important and are a must learn for a developer.
Its not as complex as it sounds to init, run and sync threads. Most systems u program for, if they are thread based will have thread sync API. The WinAPI alone has CRITICAL_SECTION which is a stand-alone mutex pretty well, you can make a Condition Variable class rather easily with some of the API provided. It comes with good wait functions like WaitForSingleObject or WaitForMultipleObjects.

Read up on POSIX, the unix thread base.

Anyone who says they are useless needs to brush up on there thread knowledge then maybe they will understand why they are rather useful.

This topic is closed to new replies.

Advertisement