[Haskell-cafe] ANNOUNCE: PriorityChansConverger-0.1

Andrey Sisoyev Andrejs.Sisojevs at nextmail.ru
Sun Jan 3 02:13:04 EST 2010

Hello, cafe!

Didn't find it in HackageDB, so made it.
Category: concurency

Converges multiple channels into one. When user reads from the PCC, the
choice is made - from which channel to read. System selects a nonempty
channel, whose (CurrentPriority, StartPriority) tuple is max. The side
effect of the channel selection is it's CurrentPriority decrease by one, if
it's value becomes less than one, then the CurrentPriority is set to

Based on STM.TChan, extended with capacity control. Version wrapped into is
also available.
The realization probably isn't very fast and isn't good at memory economy,
since it uses fresh high level primitive - STM. It wasn't intended to be
used with millions of channels. But it's max throughput comparing to the
ordinary Chan throughput is to be estimated (will do it in some future

Andrey Sisoyev
View this message in context: http://old.nabble.com/ANNOUNCE%3A-PriorityChansConverger-0.1-tp26999572p26999572.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list