title: Is it possible that a store with memory_order_relaxed never reaches other threads?
body: <p>Suppose I have a thread <strong>A</strong> that writes to an <code>atomic_int x = 0;</code>, using <code>x.store(1, std::memory_order_relaxed);</code>. Without any other synchronization methods, how long would it take before other threads can see this, using <code>x.load(std::memory_order_relaxed);</code>? Is it possible that the value written to <code>x</code> stays entirely thread-local given the current definition of the C/C++ memory model that the standard gives?</p>
  
  <p>The practical case that I have at hand is where a thread <strong>B</strong> reads an <code>atomic_bool</code> frequently to check if it has to quit; Another thread, at some point, writes <em>true</em> to this bool and then calls join() on thread B. Clearly I do not mind to call join() before thread B can even see that the atomic_bool was set, nor do I mind when thread B already saw the change and exited execution before I call join(). But I am wondering: using <code>memory_order_relaxed</code> on both sides, is it possible to call join() and block "forever" because the change is never propagated to thread B?</p>
  
  <h2>Edit</h2>
  
  <p>I contacted Mark Batty (the brain behind mathematically verifying and subsequently fixing the C++ memory model requirements). Originally about something else (which turned out to be a known bug in cppmem and his thesis; so fortunately I didn't make a complete fool of myself, and took the opportunity to ask him about this too; his answer was:</p>
  
  <blockquote>
    <p>Q: Can it theoretically be that such a store [memory_order_relaxed without (any following) release operation] never reaches the other thread?<br>
    Mark: <strong>Theoretically, yes, but I don't think that has been observed.</strong><br>
    Q: In other words, do relaxed stores make no sense
    whatsoever unless you combine them with some release operation (and
    acquire on the other thread), assuming you want another thread to
    see it?<br>
    Mark: <strong>Nearly all of the use cases for them do use release and acquire, yes.</strong></p>
  </blockquote>