<div dir="ltr">At least the code looks complete.<div style>It's a shame it uses inline asm though. Would be much nicer to implement via intrinsics.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 23 May 2013 10:17, Steven Schveighoffer <span dir="ltr"><<a href="mailto:schveiguy@yahoo.com" target="_blank">schveiguy@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 07 May 2013 15:58:34 -0400, Dmitry Olshansky <<a href="mailto:dmitry.olsh@gmail.com" target="_blank">dmitry.olsh@gmail.com</a>> wrote:<br>

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
07-May-2013 17:25, Andrei Alexandrescu пишет:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
No. A tutorial on memory consistency models would be too long to insert<br>
here. I don't know of a good online resource, does anyone?<br>
<br>
</blockquote>
<br>
Sutter's Mill is a good starting point even though it's C++ biased.<br>
<br>
Two recent insightful talks on C++11 memory model with down and dirty details:<br>
<br>
<a href="http://herbsutter.com/2013/02/11/atomic-weapons-the-c-memory-model-and-modern-hardware/" target="_blank">http://herbsutter.com/2013/02/<u></u>11/atomic-weapons-the-c-<u></u>memory-model-and-modern-<u></u>hardware/</a><br>

</blockquote>
<br>
I finally got around to watching this.  Absolutely mind-blowing, and a very very good talk.  This is what I would point people at, although it is a bit long (and necessarily so).  Didn't seem like it took 3 hours :)<br>

<br>
I take back all my arguments regarding the previous discussion, they were all wrong, along with my concept of the "issues" with out-of-order reads/writes.  I really like how Herb explains that it doesn't really matter where the re-ordering happens, to the coder, it's all the same (as if the source code is reordered), and how you can't ever really reason about code if it has races.<br>

<br>
Is D prepared to do (or does it do?) the same things that C/C++11 does with atomics?  It seems it is a necessity.  The docs on core.atomic are, well, actually missing: <a href="http://dlang.org/phobos/core_atomic.html" target="_blank">http://dlang.org/phobos/core_<u></u>atomic.html</a><br>

<br>
-Steve<br>
</blockquote></div><br></div>