<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Thanks for your help. It&#39;s more clear now.</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div>&gt; The value is not being evaluated by STM at all, as your STM functions<br>&gt; don&#39;t need the value.  In your program is evaluating when you print<br>
&gt; the answer in the main thread, as printing requires the value of the<br>&gt; computation.  If you didn&#39;t print, nothing would be computed at all.<br>&gt; Lazy =).</span><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br>
</span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Does it means that the value is computed <b>by</b> the &quot;caller&quot;, based on the thunk, and not by the worker itself? </span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">In this case, in this specific example, it would mean that this program does not exploit the parallelism at all (except using deepseq or seq). </span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">I understand the principles (lazy evaluation, thunk,...) , but I&#39;m surprised that no work has been done to &quot;solve&quot; this problem (in the sense that it&#39;s not intuitive to write concurrent programs in this context).</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">   </span></font></div>