RE: JavaMemoryModel: Non SC behaviour using volatiles.

From: Sylvia Else (sylviae@optushome.com.au)
Date: Thu Apr 15 2004 - 18:51:47 EDT


At 04:37 PM 15/04/2004 -0500, Sarita Adve wrote:
>Sylvia,
>
>There is no data race because there are no data accesses, so the example is
>correctly synchronized and must be SC. r1=v is ordered before v=1 by synch
>order as you point out. So by the synchronization consistency condition (#5)
>of the well-formed execution clause, r1=v can't see the value of v=1. (I
>notice that other parts of that condition are not as well specified as they
>could be, we'll fix that.) Let me know if I misinterpreted your question.
>
>Thanks,
>
>Sarita

Thank you Sarita.

I realised later (posting at 3am is probably never a good idea) that this
behaviour was quite unacceptable anyway, because it would render volatile
references to objects next to useless. I agree that the synchronization
consistency condition prevents it.

If there is an equivalent statement in the public review document, I
couldn't find it, or didn't recognise it when I looked for it before
submitting my posting.

As an aside, I've not always been clear which parts of the document were
specifying the model, and which parts were describing inferences that could
be drawn from the model.

Sylvia.

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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