Re: JavaMemoryModel: Use-case for strong volatile

From: Bill Pugh (
Date: Mon Apr 12 2004 - 15:17:26 EDT

On Apr 11, 2004, at 11:22 PM, Sylvia Else wrote:
> So dummyv = 0 is ordered before dummynv = dummyv. This creates a
> happens-before edge from dymmyv = 0 to dummynv = dummyv.
> If there are multiple readers, this only works under the strong
> interpretation. Is this, or something similar, what was being referred
> to as being the previously described pattern that breaks under the
> weak interpretation?
> It seems a bit odd that an optimiser could remove these statements,
> leaving only the happens-before relationships that they create.
> The dummy volatile could be removed if the t2 = v were replaced by an
> atomic compare and swap from JSR166. This would work under the weak
> interpretation.

yes, this is the "fix" I came up with for Optimistic readers.


JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:03 EDT