[Haskell-cafe] Re: Re[2]: Uses forkOS all CPUS on-board?

Simon Marlow simonmar at microsoft.com
Thu Nov 24 06:51:45 EST 2005

On 24 November 2005 01:35, Shae Matijs Erisson wrote:

> Bulat Ziganshin <bulatz at HotPOP.com> writes:
>>>> They work, even in a context switching regime, but I can't
>>>> exploit all the CPU's on my computer. Always is "active"
>>>> just one thread
>> this will not help. multi-processing support will be added in GHC
>> 6.6, which must roll out due 6 months, as HCAR says
> In the meantime, you can try it yourself by grabbing ghc 6.5 from cvs
> and reading http://www.haskell.org/~simonmar/papers/multiproc.pdf

The code is still a bit green, but it's improving.  I'm tracking down
various crashes at the moment.  By all means try it out though, and I'm
interested in any test programs and benchmarks that folk have.

To compile a program for SMP:

  - Add "GhcLibWays += s" to mk/build.mk when building GHC
  - Add -smp when compiling your code
  - +RTS -N2 -RTS to use 2 CPUs (for example)

BTW you don't need to use forkOS to get parallelism, forkIO will do.
Also we have now implemented par (as in Control.Parallel.par).


More information about the Haskell-Cafe mailing list