isEmptyChan, System.Posix.Signals

Volker Stolz stolz at i2.informatik.rwth-aachen.de
Sun Aug 15 16:45:42 EDT 2004


In local.glasgow-haskell-users, you wrote:
> 1. 'isEmptyChan x' blocks if x is empty and some other thread is waiting
> to read from x:
>
> Prelude Control.Concurrent> x <- newChan
> Prelude Control.Concurrent> forkIO $ readChan x
> Prelude Control.Concurrent> empty <- isEmptyChan x
> *** Exception: thread blocked indefinitely
>
> Is that the intended behaviour? Is it possible to make a non-blocking
> version?

This is a known limitation. Search the mailinglist-archives for a
proposed fix.
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
L-Attriwutgrammatik


More information about the Glasgow-haskell-users mailing list