Re: [Algorithms] General purpose task parallel threading approach
Brought to you by:
vexxed72
|
From: Jon W. <jw...@gm...> - 2009-04-15 15:17:22
|
asy...@gm... wrote: > When a task gets blocked by a dependency, worker thread can start > executing other tasks recursively. > So, in my world, I know what dependencies a task has before that task is started. Thus, I can prove that the task will not block, and thus no recursion (or additional stacks) necessary. The trade-off is that new dependencies can be introduced, but not synchronized, until after the current task invocation ends. The benefit is that scheduling can be a lot smarter, and the requirements for running a task are known and can be bounded (very important in embedded and otherwise limited environments). And, because tasks do not block while executing, this also means that there are no extra context switches -- each task gets switched in; that's the extent of switching. Thus, slightly less pressure on the context switcher (but optimizing switching is still worthwhile, up to a point). Sincerely, jw |