[dmd-concurrency] shutting down

Michel Fortin michel.fortin at michelf.com
Wed Jan 20 16:28:48 PST 2010


Le 2010-01-20 à 18:37, Andrei Alexandrescu a écrit :

> Sean Kelly wrote:
>> On Jan 20, 2010, at 1:00 PM, Andrei Alexandrescu wrote:
>>> I'm thinking, there are too many programs that hang when I want to end them just because some thread inside is waiting for a socket. I think that any operation that could block for an arbitrary amount of time should be disallowed during shutdown.
>> 
>> What if the program is logging to a remote host and wants to log a shutdown event?
> 
> I think it should do so in main. Nevertheless, my intuition is that we can use a judgment call a la "file operations are considered fast so we won't kill them" even though technically a file could be opened over a network connection.

This is the kind of assumption I'd gladly do without.

While typically you might consider the network slow, there are cases where the software is designed to work with some specific hardware. When you have a guarantied 1000 Mbps Ethernet crossover wire connecting directly two devices, you know the network interface isn't slow. In fact, the latency is probably much better on an 1000 Mbps Ethernet link than with a rotating hard drive.

Also if you're writing a program that works on one of these two interdependent devices, sending a shutdown notice to the other system is one thing you definitely want to do.

This is not a made-up example.

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





More information about the dmd-concurrency mailing list