September 22, 2014 Re: can't understand why code do not working | ||||
---|---|---|---|---|
| ||||
Posted in reply to Suliman | 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 |
Copyright © 1999-2021 by the D Language Foundation