
17 Jun
2003
17 Jun
'03
3:02 p.m.
Hi, I noticed that isEmptyChan blocks if the channel is already waited on by readChan, is this the intended behaviour? At least I was a bit surprised by a blocking predicate.. Example program: import Control.Concurrent main = do ch <- newChan let loop = do threadDelay 1000000 -- make sure readChan executes isEmptyChan ch print "not reached" loop forkIO loop readChan ch This happens both with 5.04.2 and 6.0, on linux. When compiled, "Fail: thread blocked indefinitely" is printed, ghci just blocks. The corresponding program with MVars doesn't block. /Peter
8058
Age (days ago)
8058
Last active (days ago)
0 comments
1 participants
participants (1)
-
Peter Strand