<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Think of it this way:<br>
    <br>
    <b>intra-</b>thread semantics isn't broken; that reordering is
    clearly allowed, because <b>intra-</b>thread there are no
    intervening writes to x.<br>
    <br>
    <br>
    Alex<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 05/05/2014 20:02, thurstonn wrote:<br>
    </div>
    <blockquote cite="mid:1399316547090-10975.post@n7.nabble.com"
      type="cite">
      <pre wrap="">...
But what about the following?
r2 == 0, r1 == 5
Which is equivalent to allowing:
r2 = x
r1 = x
y = 5

I want to say that that is a violation of intra-thread conistency
guarantees
(or intra-thread semantics if you prefer), but it's not clear to me where
specifically the JMM would prohibit that.
...
That's surprising, i.e. that r2 = 0, r1 = 5 is allowed
I guess my thinking is that this violates the *intra-thread* semantics of
the Thread 1 code, viz.

program order is dictating that r1 can never "see a later value of x" than
r2 - ok that's not very formal I guess, but it seems to violate the
intra-thread guarantees;
yes, there is no happens-before and there is no explicit dependency between
r1 and r2 . . . so all bets are off?





--
View this message in context: <a class="moz-txt-link-freetext" href="http://jsr166-concurrency.10961.n7.nabble.com/JMM-and-reorderings-tp10973p10975.html">http://jsr166-concurrency.10961.n7.nabble.com/JMM-and-reorderings-tp10973p10975.html</a>
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
_______________________________________________
Concurrency-interest mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Concurrency-interest@cs.oswego.edu">Concurrency-interest@cs.oswego.edu</a>
<a class="moz-txt-link-freetext" href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>