[Haskell-cafe] forkIO on multicore

Felipe Lessa felipe.lessa at gmail.com
Fri Dec 19 12:22:00 EST 2008


On Fri, Dec 19, 2008 at 3:16 PM, Paul Keir <pkeir at dcs.gla.ac.uk> wrote:
> can I not expect each thread to run on a separate core?

Try moving 'fibs' inside 'heavyTask', like

heavytask m = putMVar m $! (let fibs = 0 : 1 : zipWith (+) fibs (tail
fibs) in (fibs !! 100000))

Maybe this may trick the compiler into not sharing fibs.

-- 
Felipe.


More information about the Haskell-Cafe mailing list