[Haskell-cafe] System threads?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Sep 20 05:40:45 EDT 2006


On Tue, 2006-09-19 at 19:45 -0700, Lyle Kopnicky wrote:
> Hi folks,
> 
> I'm working on a project for which the solution is highly 
> parallelizable. I've been writing it so far for GHC as a single-threaded 
> app. I'd like to be able to split the job into multiple pieces, and 
> spawn different system threads for each piece, so they will run on 
> separate CPUs. Either each thread needs to write to the same IO handle, 
> or else the results need to be collected when the threads are merged, so 
> the results can all be printed.
> 
> I'm working on Linux. What's the easiest way to accomplish this? Glasgow 
> Parallel Haskell? Is there a Posix.Threads library? I understand that 
> Haskell threads (Control.Concurrent) all run in one system thread, so 
> would not take advantage of SMP.

In GHC 6.6 they can run on more than one system thread so take advantage
of SMP.

GHC 6.6 will be out soon but you can start now by trying a recent day's
6.5 snapshot. See the GHC website's download section.

Duncan



More information about the Haskell-Cafe mailing list