[Haskell-cafe] GHC multicore Haskell multicore synchronization (was Re: Weird multi-threading runtime behaviour of single-threaded program with GHC-7.0.3)

Herbert Valerio Riedel hvr at gnu.org
Tue Jun 21 11:02:37 CEST 2011

Hello Simon,

On Fri, 2011-06-17 at 09:05 +0100, Simon Marlow wrote:
> > What's happening there? The actual processing work seems to be done in a
> > single HEC... but what are the remaining 11 HECs doing exactly? Am I
> > doing something wrong?
> The answer is, they're all doing GC.  When you say -N, the parallel GC 
> is turned on, so every GC requires the cooperation of all cores.  When 
> you're running parallel code this is a big win, but for sequential code 
> it could well be a slowdown.

Speaking about cooperation of all cores... how much is the parallel GC
affected by "multitasking-noise" (is there a better name for it?) in the

There are two cases I'm thinking about:

a) Say, I have a  8-core desktop workstation and run my GC-intensive (or
massively parallel processing) Haskell program with "+RTS -N8", but I
have a few desktop apps running, and using up a bit of CPU time (but on
average just a few %)

Does this already cause significant (i.e. measurable) synchronization
delays due to 'non fully dedicated cores' in my Haskell program?

b) What about virtualized guests (e.g. with VMware, KVM, etc)? Let's
assume the Host system has 16 cores, and I partition those into 2 Guest
VMs with 8 cores each assigned; Will there be a measurable/significant
slow-downs due to synchronization delays in my "+RTS -N8" Haskell

-- hvr

More information about the Haskell-Cafe mailing list