[Haskell-cafe] Newbie question about tuples

Donald Bruce Stewart dons at cse.unsw.edu.au
Sun Jul 15 05:03:50 EDT 2007


bf3:
> Donald:
> >Yeah, there's some known low level issues in the code generator
> >regarding heap and stack checks inside loops, and the use of registers
> >on x86.
> >
> >But note this updated paper,
> >    http://www.cse.unsw.edu.au/~chak/papers/CLPKM07.html
> >
> >Add another core to your machine and it is no longer 4x slower :)
> >Add 15 more cores and its really no longer 4x slower :
> >  
> Maybe this is yet another newbie stupid question, but do you mean that 
> GHC does automatic multi-threading?  (Haskell seems very suitable for 
> that) Otherwise adding an extra core does not really help does it?
> 

No, though that would be nice! You do have to program in a parallel
manner, either by using forkIO, Control.Parallel, or parallel arrays.
When you do, you have the option of such code scaling up to more cores
relatively easily.

My advice: starting writing threaded code now, with *lots* of threads,
so your program will have the ability to start using +RTS -N16 when you
get a new machine :)

-- Don


More information about the Haskell-Cafe mailing list