Does this happen for everyone, or just me?<br><br><div class="gmail_quote">On Tue, May 5, 2009 at 2:05 PM, Jack Kennedy <span dir="ltr">&lt;<a href="mailto:jack@realmode.com">jack@realmode.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am compiling (Windows by the way) using the line from the tutorial:<div><br></div><div>ghc -O2 --make par.hs -threaded</div><div><br></div><div>and running with the line</div><div><br></div><div>par +RTS -N2</div><div><br>

</div><div>CPU usage for the process flits around a little, but stays in the 45% - 55% range.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, May 5, 2009 at 12:51 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How are you running the program? You have to explicitly tell the compiler/interpreter to use multiple system threads.<br>

<br>Michael<br><br><div class="gmail_quote"><div><div></div><div>On Tue, May 5, 2009 at 10:19 PM, Jack Kennedy <span dir="ltr">&lt;<a href="mailto:jack@realmode.com" target="_blank">jack@realmode.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div><div>In step 4 of Haskell in 5 Steps [<a href="http://haskell.org/haskellwiki/Haskell_in_5_steps" target="_blank">http://haskell.org/haskellwiki/Haskell_in_5_steps</a>],</div>


<div>a parallel program is given. I changed it very slightly so it would run a long time (see below).</div>
<div><br></div><div>It compiles and runs but my CPU meter is barely above 50%.  I have a dual core processor.</div><div>What in the world would keep this program from completely saturating the CPU?</div><div><br></div><div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">import Control.Parallel</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large"> </span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">main = a `par` b `pseq` print (a + b)</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">    where</span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">        a = ack 4 10</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">        b = ack 4 10</span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large"> </span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">fac 0 = 1</span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">fac n = n * fac (n-1)</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large"> </span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">ack 0 n = n+1</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">ack m 0 = ack (m-1) 1</span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">ack m n = ack (m-1) (ack m (n-1))</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large"> </span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">fib 0 = 0</span></span></div><div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">fib 1 = 1</span></span></div>



<div><span style="font-family:&#39;courier new&#39;,monospace"><span style="font-size:large">fib n = fib (n-1) + fib (n-2)</span></span></div><div><br></div></div>
<br></div></div>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br>