Source codeContentsIndex
Control.Concurrent.TxEvent.NWaySChan.Ver3
Portabilitynon-portable (requires TxEvent)
Stabilityexperimental
Maintainermfluet@acm.org
Contents
Synchronous n-way channels
Description

Synchronous N-Way Channels.

This library provides synchronous n-way channels, a generalization of SChan.

This library improves upon Control.Concurrent.TxEvent.NWaySChan.Ver2, by using the total order on ThreadIds to limit the possible interleavings of communications. Note that this does not require breaking the Evt abstraction.

Synopsis
data NWaySChan a
newNWaySChan :: Int -> Evt (NWaySChan a)
swapEvt :: NWaySChan a -> a -> Evt [a]
Synchronous n-way channels
data NWaySChan a
An NWaySChan is a synchronous n-way channel, used for communication between concurrent threads. Message passing is synchronous: n distinct threads must be ready to communicate; each thread sends one value and receives n-1 values.
newNWaySChan :: Int -> Evt (NWaySChan a)
Create a new n-way synchronous channel.
swapEvt :: NWaySChan a -> a -> Evt [a]
Send a value on the channel and receive n-1 values on the channel.
Produced by Haddock version 0.7