std.parallelism: How to wait all tasks finished?

Dan Killebrew dankillebrew at gmail.com
Sun Feb 2 22:56:34 PST 2014


>   // Next line will block execution until all tasks already in 
> queue finished.
>   // Almost all what I need, but new tasks will not be started.
>   taskPool.finish(true);
> }

Are you sure TaskPool.finish isn't what you're looking for?

"Signals worker threads to terminate when the queue becomes 
empty."

It seems to me that worker threads will continue as long as the 
queue isn't empty. So if a task adds another task to the pool, 
some worker will process the newly enqueued task.


More information about the Digitalmars-d-learn mailing list