can't understand why code do not working

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 22 15:03:33 PDT 2014


On 09/22/2014 01:12 PM, Suliman wrote:

 > std.concurrency.OwnerTerminated at 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



More information about the Digitalmars-d-learn mailing list