
19 Dec
2008
19 Dec
'08
12:16 p.m.
I did indeed intend for the threads to evaluate before writing to the two variables, thanks.
heavytask m = putMVar m $! (fibs !! 100000)
I now see a time difference, but as you suggested, in the wrong direction (1.5s for one, and 3.6s for two threads). I was hoping for each thread to independently calculate a fib number (but only to easily give them something to do) . Are the threads really in competition though? I'm hoping for each thread to write its own result; so giving the same answer twice. With the "-N2" and "-threaded" switches, can I not expect each thread to run on a separate core? Paul