spawn and wait

Sean Kelly via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 3 12:04:49 PDT 2014


On Thursday, 3 July 2014 at 10:25:41 UTC, Bienlein wrote:
> There is also a Semaphore and Barrier class:
>
> http://dlang.org/phobos/core_sync_barrier.html
> http://dlang.org/phobos/core_sync_semaphore.html

This is probably what I'd do, though both this and thread_joinAll
will only work if you have one kernel thread per spawn.  If
you're using a fiber-based Scheduler, this won't work as
expected.  In that case you might want to use spawnLinked and
trap the LinkTerminated messages or something like that.


More information about the Digitalmars-d-learn mailing list