
14 Sep
2010
14 Sep
'10
2:21 p.m.
Excerpts from Ertugrul Soeylemez's message of Mon Sep 13 03:03:11 -0400 2010:
In general it's better to avoid using killThread. There are much cleaner ways to tell a thread to exit.
This advice doesn't really apply to Haskell: in fact, the GHC developers have thought really carefully about this: http://research.microsoft.com/en-us/um/people/simonpj/papers/asynch-exns.ps.... 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. Edward