views:

350

answers:

2

I've been reading a number of tutorials on Haskell. However, I have not been able to get the compiled application to run on a multicore (I have an Intel Quad Core) on windows (32 bit).

I have tried a number of things:

But no luck.

The compiled application runs 100% on one core only.

Any ideas?

Code:

import Control.Parallel
import Control.Monad
import Text.Printf

fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = l `pseq` r `pseq` l+r
    where
    l = fib (n-1)
    r = fib (n-2)

main = forM_ [0..350] $ \i ->
        printf "n=%d => %d\n" i (fib i)
+5  A: 

Using par instead of pseq seems to fix it.

vili
are you running windows? Because that didn't do anything for me
cbrulak
+4  A: 

If vili is correct (I can't test as I don't own any MS boxes), it might be related to this bug

MarkusQ