[Haskell-cafe] Processor availability

Thomas DuBuisson thomas.dubuisson at gmail.com
Thu Jan 22 17:03:30 EST 2009


2009/1/22 Louis Wasserman <wasserman.louis at gmail.com>:
> How might I go about finding out how many processors are available in a
> concurrent GHC program?  I have some code I'd like to parallelize, but I
> don't want to spawn a separate (even lightweight) thread for each of
> thousands of minor tasks.

Use a thread pool and feed it tasks.  Control.Concurrent.Chan makes a
good queue.

Thomas


More information about the Haskell-Cafe mailing list