Re: [Haskell-cafe] Implementing tryReadMVar

2 Sep
2004
2 Sep
'04
11:53 a.m.
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.
Erm, but it does not matter if the readChan blocks... This is specifically for the case where there is multiple threads writing and one reading... With multiple reading threads... well it depends on the plumbing, you could have one channel per reading thread, or one channel with a single thread looking ahead for high priority events, and then instead of a FIFO, another channel going to the worker threads that just read events: do e <- readChan ch if e highPriority then process e else writeChan ch2 e Keean.
7612
Age (days ago)
7612
Last active (days ago)
0 comments
1 participants
participants (1)
-
MR K P SCHUPKE