[dmd-concurrency] Shutdown protocol

Andrei Alexandrescu andrei at erdani.com
Wed Jan 20 12:55:42 PST 2010


I understand now, thanks. Chatter on this list is getting better and 
better! Thanks to all!

Andrei

Michel Fortin wrote:
> Le 2010-01-20 à 15:40, Andrei Alexandrescu a écrit :
> 
>> Michel Fortin wrote:
>>> For the time being we could leave things as they are, but add the capability to manually call shutdown in a simple way.
>> Uhm, that sounds a lot like exit() in C.
> 
> Not at all.
> 
> By saying "leaving things as they are" I meant leaving things as you thought for the book: main thread sends a shutdown message to other threads upon termination.
> 
> "tid.shutdown()" would just send a shutdown exception to the thread, like you suggested main would do upon termination. The only reason to have a dedicated function "tid.shutdown()" instead of just writing "tid.send(new Shutdown)" is to give it a little more weight as a standard way to shutdown a thread.
> 
> 
>> An application should end when main() ends, period.
> 
> Agree.
> 
> 


More information about the dmd-concurrency mailing list