> 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
execution.
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.
Jeremy
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:50 EDT