ConcurrentUtils-0.4.1.0: Concurrent utilities

Safe HaskellNone
LanguageHaskell98

Control.CUtils.Channel

Description

A lock-free channel (queue) data structure.

Synopsis

Documentation

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.

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.