[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] ANNOUNCE: PriorityChansConverger-0.1

Subject: Re: [Haskell-cafe] ANNOUNCE: PriorityChansConverger-0.1
From: Andrey Sisoyev
Date: Sun, 3 Jan 2010 09:17:51 -0800 PST
> 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
async-excpts...
(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.

Regards,
Andrey
-- 
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.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>