On 4 May 2012 14:12, Simon Marlow <marlo...@gmail.com> 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 roots. It then send an exception to any threads which > were not reachable, which in this case is both the main thread and the > child, since neither is reachable. > > We (the user) knows that waking up the child thread will unblock the main > thread, but the RTS doesn't know this, and it's not clear how it could find > out easily (i.e. without multiple scans of the heap).
Thanks Simon, I learned something new today. Cheers, Bas _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users