Help with concurrency - traversing a DAG

qznc qznc at web.de
Wed Oct 23 06:13:58 PDT 2013


On Tuesday, 22 October 2013 at 08:13:57 UTC, tbttfox wrote:
> On Friday, 18 October 2013 at 19:47:37 UTC, qznc wrote:
>> Create a task for each node without a parent. Let the tasks 
>> create new tasks for their children.
>
> I was finally able to try this out, but I'm having a problem.
> My test case right now is a simple linked list, and what I 
> think happens is that the queue empties and makes it past the 
> pool.finish() before the worker thread can add another task to 
> the queue.
>
> Here's the code:
> http://pastebin.com/LLfMyKVp
>
> Thanks again

This pool.finish seems to be the wrong way to wait. I think you 
have to implement your own.


More information about the Digitalmars-d-learn mailing list