[Haskell-cafe] GHC strange behavior

Stefan O'Rear stefanor at cox.net
Sat Feb 16 19:55:52 EST 2008


On Sun, Feb 17, 2008 at 03:41:52AM +0300, Ruslan Evdokimov wrote:
> 2008/2/17, Stefan O'Rear <stefanor at cox.net>:
> 
> > This makes perfect sense - -N2 tells GHC to use two threads, and if you
> > run two threads on a single-processor system it's implemented by running
> > the threads alternatingly (around 100/s for modern Linux, probably
> > similar for other systems).  Thus, the two evaluations never get more
> > than a hundreth of a second out of step, and memory usage is still low.
> >
> > Stefan
> 
> Test on windows XP AthlonX2 4200+ 2Gb:
> 
> C:\imp>test
> 1
> 12328 ms
> 
> C:\imp>test +RTS -N2
> 1
> 5234 ms
> 
> C:\imp>test +RTS -N2
> 1
> 3515 ms
> 
> 1st - 1 thread
> 2nd - 2 threads on single core (one core disabled through Task Manager)
> 3rd - 2 threads on different cores

As far as I can tell, that confirms my explanation.  If you see it
differently - say how.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080216/f2d3dad6/attachment.bin


More information about the Haskell-Cafe mailing list