Re: Correct way to spawn many and stoping when one finishes ?

2016-04-13 Thread klimp via Digitalmars-d-learn
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

Re: Correct way to spawn many and stoping when one finishes ?

2016-04-10 Thread klimp via Digitalmars-d-learn
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: Actually I have to kill the other tasks, in this

Correct way to spawn many and stoping when one finishes ?

2016-04-10 Thread klimp via Digitalmars-d-learn
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: import std.concurrency, core.thread, std.random; void task() { size_t i; while (true) {