threadmanager-0.1.6: (deprecated in favor of 'threads') Simple thread management

Safe HaskellSafe-Inferred

Control.Concurrent.ThreadManager

Description

A simple thread management API inspired by the one in chapter 24 of Real World Haskell.

See http://book.realworldhaskell.org/read/concurrent-and-multicore-programming.html.

Intended to be imported qualified (suggestion: TM).

Synopsis

Documentation

make :: IO ThreadManagerSource

Make a thread manager.

fork :: ThreadManager -> IO () -> IO ThreadIdSource

Make a managed thread. Uses forkIO.

forkn :: ThreadManager -> Int -> IO () -> IO [ThreadId]Source

Make the given number of managed threads.

getStatus :: ThreadManager -> ThreadId -> IO (Maybe ThreadStatus)Source

Get the status of a managed thread.

waitFor :: ThreadManager -> ThreadId -> IO (Maybe ThreadStatus)Source

Block until a specific managed thread terminates.

waitForAll :: ThreadManager -> IO ()Source

Block until all managed threads terminate.