Re: JavaMemoryModel: Question about volatiles

From: Jeremy Manson (
Date: Wed Mar 24 2004 - 00:49:43 EST

> Sorry if I'm covering old ground. I'm passing this question on for
> someone else.
> Is it the case that "two volatiles writes by two different threads to
> two different variables must be seen in the same order by all other
> threads" or that justifications must "require a total ordering of
> volatile reads because the synchronization order must be total"?

Yes. There is a total order over all synchronization actions in a given
execution (including volatile reads and writes). Each volatile read must
see the last volatile write to that variable that occurred in the total

> Are the following allowed by the new model?

The behaviors you described are not legal.

JavaMemoryModel mailing list -

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