Re: JavaMemoryModel: New test case?

From: Bill Pugh (pugh@cs.umd.edu)
Date: Tue Mar 09 2004 - 14:38:46 EST


My first reaction to this test case is that the behavior in question is
neither something that must be prohibited nor something that must be
allowed.

I don't see any reasonable optimizations that would result in this
behavior, nor do I see any immediate problems with allowing this.

Bill

On Mar 8, 2004, at 8:29 PM, Vijay Saraswat wrote:
>
>
> ----------------------------------------------------------
> Test 14a
> Initially: a=b=y=0
>
> Thread 1
> r1 =a
> if (r1 == 0)
> y =1
> else
> b =1
>
> Thread 2
> r2=y
> r3=b
> if (r2+r3 !=0)
> a=1
>
> Question: r1=r3=1, r2=0?
> ---------------------------------------------------------------

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



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