<div dir="ltr">Well, there are cases where even with single-threading you want a memory barrier to prevent the CPU reordering instructions, but the shift to a single-threaded runtime should elide _some_ locks expressly designed to cope with multithreading.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 24, 2016 at 5:04 PM, Thomas Koster <span dir="ltr"><<a href="mailto:tkoster@gmail.com" target="_blank">tkoster@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yuras,<br>
<span class=""><br>
On Sun, 2016-01-24 at 17:46 +1100, Thomas Koster wrote:<br>
> 2. When given two capabilities (+RTS -N2), MVars are suddenly an<br>
> order<br>
> of magnitude slower than with just one capability. Why?<br>
<br>
</span><span class="">On 25 January 2016 at 02:09, Yuras Shumovich <<a href="mailto:shumovichy@gmail.com">shumovichy@gmail.com</a>> wrote:<br>
> One possible explanation is closure locking which is not performed when<br>
> there is only one capability. In my quick measurements it gives 40%<br>
> speedup: <a href="https://ghc.haskell.org/trac/ghc/ticket/693#comment:9" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/693#comment:9</a><br>
<br>
</span>This makes sense. After all, why bother with locks and barriers when<br>
the process is single-threaded anyway?<br>
<span class="im HOEnZb"><br>
Thanks for your response.<br>
<br>
--<br>
Thomas Koster<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Chris Allen<br><div><span style="font-size:12.8000001907349px">Currently working onĀ </span><a href="http://haskellbook.com" target="_blank">http://haskellbook.com</a></div></div></div></div></div></div>
</div>