Re: Weird behavior of the NonTermination exception

2012-05-04 Thread Bas van Dijk
On 4 May 2012 14:12, Simon Marlow wrote: > The forked thread is deadlocked, so the MVar is considered unreachable and > the main thread is also unreachable.  Hence both threads get sent the > exception. > > The RTS does this analysis using the GC, tracing the reachable objects > starting from the

Re: Weird behavior of the NonTermination exception

2012-05-04 Thread Simon Marlow
On 03/05/2012 17:14, Bas van Dijk wrote: On 3 May 2012 17:31, Edward Z. Yang wrote: Excerpts from Bas van Dijk's message of Thu May 03 11:10:38 -0400 2012: As can be seen, the putMVar is executed successfully. So why do I get the message: "thread blocked indefinitely in an MVar operation"? G

Re: Weird behavior of the NonTermination exception

2012-05-03 Thread Bas van Dijk
On 3 May 2012 18:14, Bas van Dijk wrote: > Now it seems the thread is killed while delaying. But why is it > killed? Oh I realise the forked thread is killed because the main thread terminates because it received a BlockedIndefinitelyOnMVar exception and then all daemonic threads are killed. Bas

Re: Weird behavior of the NonTermination exception

2012-05-03 Thread Bas van Dijk
On 3 May 2012 17:31, Edward Z. Yang wrote: > Excerpts from Bas van Dijk's message of Thu May 03 11:10:38 -0400 2012: >> As can be seen, the putMVar is executed successfully. So why do I get >> the message: "thread blocked indefinitely in an MVar operation"? > > GHC will send BlockedIndefinitelyOnM

Re: Weird behavior of the NonTermination exception

2012-05-03 Thread Edward Z. Yang
Excerpts from Bas van Dijk's message of Thu May 03 11:10:38 -0400 2012: > As can be seen, the putMVar is executed successfully. So why do I get > the message: "thread blocked indefinitely in an MVar operation"? GHC will send BlockedIndefinitelyOnMVar to all threads involved in the deadlock, so it'

Weird behavior of the NonTermination exception

2012-05-03 Thread Bas van Dijk
Hello, Before I turn the following into a ticket I want to ask if I miss something obvious: When I run the following program: - import Prelude hiding (catch) import Control.Exception import Control.Concurrent main :: IO () main = do mv <- newEmp