Re: [Algorithms] General purpose task parallel threading approach
Brought to you by:
vexxed72
|
From: Nicholas \Indy\ R. <ar...@gm...> - 2009-04-04 10:22:15
|
On Sat, Apr 4, 2009 at 2:55 AM, <asy...@gm...> wrote: > Originally I was trying to solve the problem of how to write a server, > serving multiple clients simultaneously utilizing all cores without writing > a state machine for each client (I found out that it is damn complex to > extend logic when it is expressed via state machine). > The solution I have now perfectly fits imho - I only need to write a task > per client which does simple send/receive (as if you'd write a single > threaded application), and I get ideal multicore scale. It's problematic trying to take an approach that works well for servers and extend it for video games. Most servers have very low data contention, don't worry to much about small variances in latency and spend a lot of time waiting around on IO and the like. On the other hand, video games not designed for multi threading generally have very high data contention, which require many locks, and at that point, the cache misses generally provide just as much of a performance hit as the lock itself. Latency requirements are very strict, and additionally, most games spend very little to zero time in IO and when so it is almost always in loading, or designed async to begin with. And given such there is not a lot of time to fit in extra cycles for worker threads on the main CPU. Indy |