
4 Apr
2006
4 Apr
'06
9:42 a.m.
Li, Peng wrote:
Suppose the following happens:
(1) Thread A calls readChan on an empty channel and waits (2) Thread B puts something to the read-end of the channel using unGetChan
When a GHC program does this, both threads are blocked! Is it the behaviour we really want for unGetChan, or should we fix the implementation for Control.Concurrent.Chan?
Good point. Can you think of a good fix? Interestingly, the STM TChan works perfectly in this respect. Draw your own conclusion :) Cheers, Simon