JavaMemoryModel: [Figure fix]: Should we prohibit all causal loops?

From: Bill Pugh (pugh@cs.umd.edu)
Date: Fri Jun 27 2003 - 14:28:13 EDT


The prohibited behaviors referred to x and y in Figures 2-4; they
should have referred to r1 and r2:

--------------
Figure 2: Initially, x = y = 0

Thread 1 Thread 2
r1 = x r2 = y
if r1 > 0 if r2 > 0
   then y = 42 then x = 42

Prohibited behavior: r1 == r2 == 42
--------------

Figure 3: Initially, x = y = 0

Thread 1 Thread 2
r1 = x r2 = y
y = r1 x = r2

Prohibited behavior: r1 == r2 == 42
--------------

Figure 4: Initially, x = y = 0
Thread 1 Thread 2
r1 = x r2 = y
if r1 > 0 if r2 > 0
   then y = 42 then x = 17
   else y = 0 else x = 0

Prohibited behavior: r1 == 17, r2 == 42
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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