[dmd-concurrency] Shutdown protocol

Andrei Alexandrescu andrei at erdani.com
Thu Jan 21 12:38:46 PST 2010


Sean Kelly wrote:
> On Jan 21, 2010, at 12:35 PM, Steve Schveighoffer wrote:
>> Maybe in the event that the threads exit in the order you join them, but the end result is the main thread resumes immediately after the last thread exits.  Calling join on a finished thread does not require any context switching or messages, it simply returns immediately with the exit code.
> 
> Yeah exactly.  Joining in a loop shouldn't be noticeably slower than joining all in parallel.

Not if they want to close sockets gracefully or best-effort-gracefully 
as in your destructor example. Actually your own destructor example 
ruins your point because it has a relatively high latency!!!

Andrei


More information about the dmd-concurrency mailing list