[dmd-concurrency] Shutdown protocol
Andrei Alexandrescu
andrei at erdani.com
Thu Jan 21 11:28:41 PST 2010
Steve Schveighoffer wrote:
> ----- Original Message ----
>
>> From: Andrei Alexandrescu <andrei at erdani.com>
>> Steve Schveighoffer wrote:
>>> foreach(tid; tids) {tid.join();}
>> Oh btw that shouldn't be coded like that, it's slow. Must be something like:
>>
>> joinAll(tids);
>>
>> so joining is initiated in parallel.
>>
>
> What does joinAll do? I admit I am not too familiar with your proposed API.
The idea is to join on all threads in parallel. Otherwise, if you have N
threads, the Nth will become aware you plan to shutdown only after all
others have already finished.
> And are we talking slow as in several milliseconds slower or several seconds slower? :)
The differences could be eminently measurable.
Andrei
More information about the dmd-concurrency
mailing list