Re: JavaMemoryModel: Another litmus test for strong vs. weak volatiles

From: Thomas Wang (wang@cup.hp.com)
Date: Thu Mar 18 2004 - 20:38:03 EST


>Initially, x = y = v = 0, v is volatile
>Thread 1:
>x = 1
>v = 1
>
>Thread 2:
>y = 1
>v = 2
>
>Thread 3:
>r1 = v
>r2 = v
>
>Thread 4:
>r3 = v
>r4 = x
>
>Behavior in question: r1 = 1, r2 = 2, r3 = 2, r4 = 0

For IA64, under the C compiler, I believe the behavior cannot occur.
I don't believe our version of jdk 1.4 will allow this behavior either.

>Bill

 Thomas Wang

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



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