Re: [Algorithms] General purpose task parallel threading approach
Brought to you by:
vexxed72
|
From: Jarkko L. <al...@gm...> - 2009-04-05 20:41:43
|
With job stealing from other threads you don't get global prioritization, so one task may be executing lower priority tasks and not to work towards optimal throughput. Cheers, Jarkko _____ From: Sebastian Sylvan [mailto:seb...@gm...] Sent: Sunday, April 05, 2009 4:32 AM To: Game Development Algorithms Subject: Re: [Algorithms] General purpose task parallel threading approach On Sun, Apr 5, 2009 at 2:11 AM, Jarkko Lempiainen <al...@gm...> wrote: Sub-tasks spawn by a task are not necessarily run serially by the same worker thread though. Worker threads should pull tasks from job queue based on task priority, so those spawned tasks are likely to be executed by many worker threads instead. That's probably not a good idea. Work-stealing is a pretty well-established as the current best solution (with provable performance properties) for task-based parallelism as it combines locality with low contention and still gets optimal load-balancing. Going to shared queue every single task (and probably incurring a cache miss if the task is unrelated to what you were just doing) is a lot more costly than just pushing tasks off of your own mostly private stack (and only interfering with other threads when you and they run out of stuff to do simultaneously). -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 |