[Haskell] Blocked STM & GC question
simonpj at microsoft.com
Mon Sep 17 08:46:41 EDT 2007
[Redirecting to GHC Users which is the right place for questions about GHC.]
Yes, the garbage collector will (well, certainly should) find and kill such threads. By "kill" I mean that they get sent an asynchronous exception of some kind (I hope the documentation says which) so that the thread has a chance to clean up rather than being forcibly terminated.
I'm not quite sure where this fact should be documented -- documentation for GHC itself, or for the STM library? -- but it surely should be somewhere.
| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org]
| On Behalf Of Ashley Yakeley
| Sent: 15 September 2007 21:39
| To: haskell at haskell.org
| Subject: [Haskell] Blocked STM & GC question
| If I have a thread that's blocked on an STM retry or TChan read, and
| none of its TVars are referenced elsewhere, will it get stopped and
| I have in mind a pump thread that eternally reads off a TChan and
| the result to some function. If the TChan is forgotten elsewhere, will
| the permanently blocked thread still sit around using up some small
| amount of memory, or will it be reaped by the garbage collector?
| Ashley Yakeley
| Seattle WA
| Haskell mailing list
| Haskell at haskell.org
More information about the Glasgow-haskell-users