
2 Sep
2004
2 Sep
'04
7:57 a.m.
On 01.09 18:30, MR K P SCHUPKE wrote:
while channel not empty read next event if event high priority process now else queue event in FIFO process first event in FIFO
That suffers from the same problem as I described. do e <- isEmptyChan ch -- is the channel empty? case e of True -> processFifo False-> readChan ch >>= highPriorityOrPush Now there is danger of blocking on the readChan. (consider a case where we create two similar server processes reading the same channel). Now we create a tryReadChan, but we cannot implement it with tryTakeMVar, as that would break dupChan. Rather we need a tryReadMVar or a different channel abstraction. - Einar Karttunen