On 09/22/2014 01:12 PM, Suliman wrote:
> std.concurrency.OwnerTerminated@std\concurrency.d(234): Owner terminated
> ----------------
I feel bad about that uninteresting first example that lost you time. :(
There are a number of options:
- The main thread can call thread_joinAll() to wait for all workers to
finish.
- The threads can have a protocol to signal each other that they are
done. (I used 'struct Exit' in that chapter.)
- Threads can detect exceptions like OwnerTerminated and act accordingly.
The rest of the chapter has examples of those options.
Ali