[Haskell-beginners] Learning about channels

Daniel Fischer daniel.is.fischer at web.de
Tue May 25 07:31:51 EDT 2010


On Tuesday 25 May 2010 12:35:38, Benjamin Edwards wrote:
> Having read
> this<http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0.0/Cont
>rol-Concurrent.html>page a bit more I think I understand why the prgram
> was blocking, but if I compile with -threaded surely the readChan
> function shouldn't prevent the producer from producing?

I'm afraid that is not so, "The downside of having lightweight threads is 
that only one can run at a time" and I compiled the original with -threaded 
and got:
$ ./chanTest +RTS -N2
chanTest: thread blocked indefinitely in an MVar operation


More information about the Beginners mailing list