<br><br><div class="gmail_quote">On Tue, Sep 14, 2010 at 11:29 AM, Bryan O&#39;Sullivan <span dir="ltr">&lt;<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Tue, Sep 14, 2010 at 11:21 AM, Edward Z. Yang <span dir="ltr">&lt;<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Pure code can always be safely asynchronously interrupted (even code<br>
using state like the ST monad), and IO code can be made to interact<br>
correctly with thread termination simply by using appropriate bracketing<br>
functions that would handle normal IO exceptions.<br></blockquote><div><br></div></div><div>Ertugrul&#39;s advice is still correct. I&#39;d wager there are very few concurrent applications that could survive a killThread without disaster. People simply don&#39;t write or test code with that in mind, and even when they do, it&#39;s more likely than not to be wrong.</div>
</div></blockquote><div><br></div><div>I don&#39;t use killThread, and I write what I&#39;d call somewhat complex concurrent Haskell software for a living right now :-).</div><div><br></div><div>Instead I have a TChan of commands that I can send to a thread, either from the outside or inside, and that thread will eventually come back to it&#39;s event loop that looks at such messages, and shut down gracefully from there.</div>
<div><br></div><div>Of course the only time this would happen is if something goes wrong and I&#39;m going to restart and forget all the data I have accumulated thus far anyway.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote">
</div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>