[dmd-concurrency] Shutdown protocol
Sean Kelly
sean at invisibleduck.org
Wed Jan 20 15:23:53 PST 2010
On Jan 20, 2010, at 11:26 AM, Andrei Alexandrescu wrote:
>
> I don't think so. When the two instances of the copy threads finish reading and sending messages to their writers, they return. As a consequence, wait returns. As a consequence, main finishes.
>
> At this critical point, we have the following situation:
>
> (a) main has finished, therefore the shutdown mode is in effect
>
> (b) There are a number of messages in flight containing buffers waiting to be written in the two files.
>
> The important thing to do is to NOT throw shutdown as long as calls to receive() would not block.
That sounds like a horrible race problem.
More information about the dmd-concurrency
mailing list