std.parallelism: How to wait all tasks finished?

Chris Williams yoreanon-chrisw at yahoo.co.jp
Wed Feb 5 14:10:31 PST 2014


On Wednesday, 5 February 2014 at 15:38:14 UTC, Cooler wrote:
> Will not help. I don't know beforehand what tasks will be
> created. procData is recursive and it decides create new task or
> not.

You seem to be saying that you want to be able to wait for all 
tasks to complete an indefinite number of times, adding more 
tasks after each one. Why would you want to do that? The queue 
for the pool is infinitely long, so just keep adding tasks till 
you have no more tasks to add. Or if you have a progression of 
types, like all tasks of type A have to be complete before you 
can start running the tasks of type B, then you should be able to 
have a separate thread pool for each type.


More information about the Digitalmars-d-learn mailing list