On Tuesday, 12 April 2016 at 12:12:19 UTC, Steven Schveighoffer wrote:
On 4/10/16 4:59 AM, klimp wrote:
On Sunday, 10 April 2016 at 07:48:51 UTC, klimp wrote:
Is this corrrect ? Each task searches for the same thing so when once has found the others don't need to run anymore. It looks a bit strange
not to stop those who havent find the thing:
How can I kill a Tid ?

Short answer: don't.

This is kind of why there isn't a handy function to do so.

If you kill a thread, there is no telling what state it is in, what locks it has held, etc.

The best (and really only) way to manage threads is through a loop that checks periodically whether it should quit.

-Steve

I've solved the problem by atomically reading/writing a shared bool. That works fine, though I don't really need spawn() anymore. core.thread.Thread with a callback is widely enough.

Reply via email to