<div dir="ltr">Who throws the exception? Documentation of `throwTo` sais that the calling thread is blocked until the exception is delivered. If the target thread has async exceptions masked then the exception is never delivered.<div><br></div><div>Does that also mean a blocked thread which has async exceptions masked is, essentially, a resource leak?<br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 18, 2015 at 5:23 AM Michael Sloan <<a href="mailto:mgsloan@gmail.com">mgsloan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In this case, the GC will indeed find that no one has a reference to the thread.  However, instead of garbage collecting the thread, the BlockedIndefinitely exception is thrown to it.  So, it resumes execution of the thread with that exception.<div><br></div><div>This also applies to threads blocked on MVars.</div><div><br></div><div>-Michael</div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Sat, Oct 17, 2015 at 9:11 AM, Tomas Carnecky <span dir="ltr"><<a href="mailto:tomas.carnecky@gmail.com" target="_blank">tomas.carnecky@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If a thread is blocking indefinitely in an STM transaction (reading from a queue to which nobody else has a reference and thus can not write into), is the runtime smart enough to GC the thread? Or do I have to kill the thread manually?</div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div>