JavaMemoryModel: Question about the semantics of volatile (typo fix)

From: Bill Pugh (pugh@cs.umd.edu)
Date: Wed Mar 17 2004 - 15:42:11 EST


Sorry, behaviors should have been r1 == r3 == 1.

Initially, x = y = v = 0.
v is a volatile variable.

Thread 1:
r1 = x
v = 0
r2 = v
y = 1

Thread 2:
r3 = y
v = 0
r4 = v
x = 1

Is the behavior r1 == r3 == 1 possible?

The weak interpretation allows this behavior, the strong
interpretation does not.

Bill

-------------------------------
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