[concurrency-interest] DCL using Fence Intrinsics

vikas vikas.vksingh at gmail.com
Thu Mar 12 19:48:16 EDT 2015


*In 2, compiler can move a=1 after the loop*

Not sure what you meant here a==1 is a read operation and already after the
loop

*For 3, if you put loadFence inside the while loop it will work*
 Not sure why it will work 

*I can't see why you even need the loadFence.*
Probably without load fence you may not see all fields of Singleton fully
initialized.
There is not happens before relation between storeFence and reading of
instance variable.





--
View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/DCL-using-Fence-Intrinsics-tp12420p12422.html
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.


More information about the Concurrency-interest mailing list