[Haskell-cafe] Re: Cleaning up threads

Gregory Collins greg at gregorycollins.net
Tue Sep 14 15:04:27 EDT 2010


"Bryan O'Sullivan" <bos at serpentine.com> writes:

> On Tue, Sep 14, 2010 at 11:21 AM, Edward Z. Yang <ezyang at mit.edu> wrote:
>
>     Pure code can always be safely asynchronously interrupted (even code
>     using state like the ST monad), and IO code can be made to interact
>     correctly with thread termination simply by using appropriate bracketing
>     functions that would handle normal IO exceptions.
>
> Ertugrul's advice is still correct. I'd wager there are very few
> concurrent applications that could survive a killThread without
> disaster. People simply don't write or test code with that in mind,
> and even when they do, it's more likely than not to be wrong.

That's surprising to me -- this is how we kill the Snap webserver
(killThread the controlling thread...).

G
-- 
Gregory Collins <greg at gregorycollins.net>


More information about the Haskell-Cafe mailing list