[Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Mitar
Hi! Is there a way to disable throwing BlockedIndefinitelyOnMVar exceptions? Because I am doing small program where I do not care if some threads block. As at the end user will have to interrupt the program anyway. Mitar ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Edward Z. Yang
I don't know if there's a way to disable it, but you can wrap all your spawned threads with an exception handler that catches BlockedIndefinitelyOnMVar and ignores it. If the thread blocks indefinitely, it's as good as dead, so there won't be any difference in behavior. Cheers, Edward

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Gregory Collins
I find this behaviour a little annoying. Sometimes I *want* the thread to block indefinitely! I.e. I want it to block until it receives a KillThread exception. Is there a better way to accomplish that without waiting on an MVar which will never fill? As a workaround what I've been doing lately is

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Neil Brown
On 31/03/11 11:03, Gregory Collins wrote: I'm guessing the trigger condition for BlockedIndefinitelyOnMVar is blocked and mvar refcount == 1 It's not simply a reference count (the thread that's blocked forever can hold multiple references to the MVar and it's still blocked indefinitely).

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Brandon Moore
From: Gregory Collins g...@gregorycollins.net Sent: Thu, March 31, 2011 5:03:09 AM I find this behaviour a little annoying. Sometimes I *want* the thread to block indefinitely! I.e. I want it to block until it receives a KillThread exception. Is there a better way to accomplish that

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Mitar
Hi! On Thu, Mar 31, 2011 at 4:37 PM, Brandon Moore brandon_m_mo...@yahoo.com wrote: If you plan to send an exception, you must have the ThreadId saved elsewhere, which should prevent the BlockedIndefinitelyOnMVar exception. But this behavior is something they wish to remove in future versions

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Brandon Moore
- Original Message From: Mitar mmi...@gmail.com To: Brandon Moore brandon_m_mo...@yahoo.com Cc: Gregory Collins g...@gregorycollins.net; Edward Z. Yang ezy...@mit.edu; Haskell Cafe haskell-cafe@haskell.org Sent: Thu, March 31, 2011 2:06:31 PM Subject: Re: [Haskell-cafe