[concurrency-interest] Can a volatile read be reordered before a lazySet?

Nitsan Wakart nitsanw at yahoo.com
Wed Dec 31 02:20:54 EST 2014


Re-read the Shipilev "JMM Pragmatics" reference again last night, and discussed with Gil. I think that cup of coffee was nowhere near enough :-). In particular:
"If IUC this means stores and volatile loads are conservatively not reordered" is FALSE because the premise "IUC" is false. I did not understand correctly which leads me to amend my comment:1. There's technically nothing to stop reordering between the store and load.
>  theLong.lazySet(1L);
>  Object o = theRef.get();
2. There's technically nothing to stop reordering between the store and load.>  long l = theLong.get() + 1; // LOADLOAD
>  theLong.lazySet(l); //STORESTORE
>  Object o = theRef.get(); // LOADLOAD
3. I still think the while loop presents a different case to normal flow. So for now I still hold that the lazySet cannot be moved after the while loop.
My sincere apologies for the confusion.Happy holidays to all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141231/4bbd67f7/attachment.html>


More information about the Concurrency-interest mailing list