[Haskell-cafe] ANNOUNCE: PriorityChansConverger-0.1
Andrejs.Sisojevs at nextmail.ru
Sun Jan 3 12:17:51 EST 2010
> thanks, it will be useful.
That's pleasant to hear, Bulat. =)
> whether it works in IO or STM monad?
I made both versions.
PriorityChansConvergerSTM is made in STM in one module. And in another
module STM version is wrapped into IO. The IO version is a buildup on top of
STM version, and it has additional properties:
(1) It (PCC in IO monad) uses MVar locks to secure system from "waste work".
I thought, that transactions don't look too lightweight, so few bottleneck
would be great... The negative side of this, is that asynchronous exception
may cause loss of locks. Probably in a future version I will try to
introduce more advanced locking mechanics, which will be secure facing
(2) STM version has interruptableRead and interruptableWrite operations,
whose interruption is controlled with parameter (STM Bool). IO version also
has these operations + interruptables, that are controlled by parameter
(Chan a, a -> Bool). I'm no sure if interruptables for IO monad are made
optimal - they do spawn additional temporary threads, but I didn't see any
better way to make this interruption.
View this message in context: http://old.nabble.com/ANNOUNCE%3A-PriorityChansConverger-0.1-tp26999572p27002956.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe