Re: JavaMemoryModel: The choice we need to make on test cases 5 and 10

From: Jeremy Manson (
Date: Sat Aug 02 2003 - 10:44:30 EDT

> I have the same concern with Sarita regarding test 6.
> One line of thought is this (another view of Sarita's concern):
> If r1=A=1 and r2=B=1 is a legal outcome of the execution, then one
> doesn't really care about the second if statement in t2 since it'll never
> be carried out in this particular execution. So this second if statement
> shouldn't affect the legality of the trace. As a result, it should be
> treated in the same way as if the 2nd if statement doesn't exist.

I'm pretty sure this is not true. You need to have the second if
statement there to reason about the fact that A = 1 will happen in every

If the second if statement is not there, the program is correctly
synchronized, in the accepted sense of "no data races in a sequentially
consistent execution of the program". In that case, both Sarita's and our
models forbid the read of 1 in either thread.

JavaMemoryModel mailing list -

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