[dmd-concurrency] Shutdown protocol
Sean Kelly
sean at invisibleduck.org
Thu Jan 21 12:35:45 PST 2010
On Jan 21, 2010, at 12:33 PM, Andrei Alexandrescu wrote:
> Sean Kelly wrote:
>> On Jan 21, 2010, at 12:18 PM, Andrei Alexandrescu wrote:
>>> Sean Kelly wrote:
>>>> On Jan 21, 2010, at 9:40 AM, Sean Kelly wrote:
>>>>> All this talk makes me think of a funny feature Apple added to Mac OS X 10.6 (Snow Leopard): Sudden Termination. When you shutdown the computer, the OS literally kills every process having the sudden termination flag set. Applications are free to set and unset this flag as they run. Typically, an application with no document open will set its sudden termination flag. But the flag is not set by default so applications can do proper cleanup.
>>>> Funny, that sounds a lot like setting the isDaemon flag on threads :-)
>>> That flag says "I don't need to do special cleanup upon exit, just kill me." I think that's different from isDaemon.
>> Not at all. If a normal application receives a shutdown event it can work for as long as it wants to before actually shutting down. I see this when shutting down Windows and OSX all the time--some editor pops up a "save" dialog and shutdown eventually times out and aborts.
>
> In Linux and "classic" i.e. non-OSX Unixen, the shutdown process ultimately kills it :o).
That's analogous to the connection class dotr I sent that gives up after some interval. I actually like this approach, but only on a case-by-case basis.
More information about the dmd-concurrency
mailing list