[Haskell-cafe] Haskell Speed Myth
Aaron Tomb
atomb at galois.com
Fri Aug 29 12:29:44 EDT 2008
On Aug 29, 2008, at 9:11 AM, Isaac Gouy wrote:
> The benchmarks game always seems to demand somewhat unnatural acts and
> here's another - is there an effective way to /prevent/ ghc using
> multiple cores when multiple cores are available? Can we force ghc to
> only use one core on the quadcore machine? (Moreover can we do the
> same
> trick for other languages?)
There is indeed. In fact, GHC-compiled programs will only use multiple
processors if you explicitly tell them to. To make use of two
processors, for instance, you have to pass the flags '+RTS -N2' to the
compiled executable when you run it. This tells it to schedule its
internal threads on two OS threads, which the OS will presumably run
on two processors if possible.
Aaron
More information about the Haskell-Cafe
mailing list