[dmd-concurrency] Shutdown protocol

Michel Fortin michel.fortin at michelf.com
Wed Jan 20 12:53:00 PST 2010


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.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-concurrency mailing list