[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.

Simon

| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
| On Behalf Of Ashley Yakeley
| Sent: 15 September 2007 21:39
| To: [EMAIL PROTECTED]
| 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
| garbage-collected?
|
| I have in mind a pump thread that eternally reads off a TChan and
| pushes
| 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
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/haskell
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to