<div class="gmail_quote">On Sat, Sep 22, 2012 at 10:17 AM, N.M. Maclaren <span dir="ltr"><<a href="mailto:nmm1@cam.ac.uk" target="_blank">nmm1@cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":841">You have been given clear references to the sequence point rules, which<br>
make it clear that there must be a sequence point between updates.<br>
There is and can be no such sequence point when a location is updated<br>
by passive one-sided communication and is later used in the process<br>
that owns the data.  Muttering about fences is irrelevant, because the<br>
same applies even when you have them.  The other MPI facilities were<br>
carefully designed to ensure that there IS such a sequence point.</div></blockquote></div><br><div>The same point applies to multithreaded programming, see Boehm's classic paper. And yet such multithreaded software underlies such core infrastructure as our operating systems kernels and high-performance databases. It is why C11 and C++11 have a memory model, allowing such necessary synchronization without everyone adopting inline assembly or compiler extensions. I fail to see how fences are irrelevant. They can obviously be used incorrectly, but ensuring a partial order on observations of memory operations is exactly what is needed to ensure correctness.</div>