[concurrency-interest] DCL using Fence Intrinsics

Oleksandr Otenko oleksandr.otenko at oracle.com
Fri Mar 13 09:18:24 EDT 2015


I think there is a formatting issue. The loop for Code 2 appears in T1, 
but you probably meant T2.

Alex

On 12/03/2015 23:48, vikas wrote:
> *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.
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list