ConcurrentUtils-0.4.1.0: Concurrent utilities
Control.CUtils.Channel
Description
A lock-free channel (queue) data structure.
Synopsis
data Channel a t Source
newChannel :: MArray a t IO => Word32 -> IO (Channel a t) Source
Create a channel with a buffer at least as big as buffer.
buffer
writeChannel :: MArray a e IO => Channel a e -> e -> IO () Source
Write into the channel, blocking when the buffer is full.
readChannel :: MArray t b IO => Channel t b -> IO b Source
Read from the channel, blocking when the buffer is empty.