Re: [Algorithms] General purpose task parallel threading approach
Brought to you by:
vexxed72
|
From: Jon W. <jw...@gm...> - 2009-04-14 20:37:20
|
asy...@gm... wrote: > I still didn't get a clear picture of what I need to change to make > asynclib an attractive threading library for games. As seen from my point of view, the two top-level changes would be: 1) Don't allocate a stack per task. Instead, allocate a stack per worker thread. (The bonus is that these stacks can be large enough to be useful, without too much overhead) 2) Let each task have a dependency tree, where a task will automatically become runnable when all its dependencies are complete (and a typical dependency will be the completion of some other task). Now, if you really want to support arbitrary blocking within the execution of a micro-task (which I feel is a mistake), then you can make it so that you allocate a new stack for the next task only when some stack is "used" because there is a blocking task. Sincerely, jw |