[Haskell-cafe] System threads?
Simon Peyton-Jones
simonpj at microsoft.com
Mon Sep 25 04:52:32 EDT 2006
| 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.
GHC 6.6 (release candidate available) supports parallel execution on SMP
machines.
http://www.haskell.org/ghc/dist/current/docs/users_guide/sec-using-smp.h
tml
Garbage collection is not parallelised yet, something we plan to fix
this autumn.
If you want a distributed memory machine (e.g. cluster of boxes) then
you may want GPH,
http://www.macs.hw.ac.uk/~dsg/gph/
although it's based on an older version of GHC.
Simon
| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Lyle
| Kopnicky
| Sent: 20 September 2006 03:46
| To: haskell-cafe at haskell.org
| Subject: [Haskell-cafe] System threads?
|
| 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.
|
| I suppose in the worst case I can write a shell program that divides
up
| the problem, runs several worker processes to output intermediate
| results to files, then combines the results to the desired filehandle.
|
| Thanks,
| Lyle
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list