ad-dualrev-th-0.1.0.0: Implementation of dual-numbers reverse AD for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Concurrent.ThreadPool

Synopsis

Pools

data Pool Source #

A thread pool.

mkPool :: IO Pool Source #

Create a new thread pool with one worker for every capability (see getNumCapabilities).

mkPoolN :: Int -> IO Pool Source #

Create a new thread pool with the given number of worker threads.

globalThreadPool :: Pool Source #

A statically allocated thread pool.

scalePool :: Pool -> Int -> IO () Source #

When the target size is smaller than the original size, this mercilessly and immediately kills some workers. If you have jobs running, they may well be cancelled.

Running jobs

submitJob :: Pool -> IO () -> IO () Source #

Submit a job to a thread pool.

Debug