[concurrency-interest] Volatile stores in constructors, disallowed to see the default value

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Nov 27 12:42:26 EST 2013

Hi Andreas,

On 11/27/2013 05:17 PM, Andreas Lochbihler wrote:
> I think that 0 is also an acceptable outcome. In your reasoning, you do
> not distinguish between synchronization order (so) and synchronizes-with
> order (sw), and only sw if part of the happens-before order (hb). The
> difference is that so orders all access to volatile whereas sw only
> orders writes before subsequent reads, but not reads before (subsequent)
> writes (JLS 17.4.4, 2nd bullet).

Thanks Andreas, that's indeed the flaw which demolishes the significant
part of the proof. It seems like both traces are committable, yielding
both {0, 42}. Let me go through the JMM again to understand your commit
sequence completely.


More information about the Concurrency-interest mailing list