JavaMemoryModel: Test Case 18 variations

From: Vijay Saraswat (vijay@saraswat.org)
Date: Thu Mar 18 2004 - 11:50:02 EST


I am curious what the group thinks about the variants of Test case 18
copied below (and also at http://www.saraswat.org).

Best,
Vijay


Additional Causality Test Cases

Causality Test Cases

See Bill Pugh's Causality Test cases list for the original list.

Here I describe variations on some of the contentious tests in that list.

Causality test case 18a

Initially,  x = y = 0

Thread 1:
r3 = x
if (r3 == 0)
  x = 42
r1 = x
y = r1

Thread 2:
r2 = y
x = r2

Thread 3:
r4 = x
if (r4 == 71)
  x = 71

Behavior in question: r1 == r2 == r3 == 42

Proposed Decision: Disallowed. (See Test 18 which is currently allowed.)

Causality test case 18b

Initially,  x = y = 0

Thread 1:
r3 = x
if (r3 == 0)
  x = 41
if (r3 == 0)
  x = 42
r1 = x
y = r1

Thread 2:
r2 = y
x = r2

Behavior in question: r1 == r2 == r3 == 42

Proposed Decision: Disallowed. (See Test 18 which is currently allowed.)


Causality test case 18c

Initially,  x = y = 0

Thread 1:
r3 = x
if (r3 == 41)
  x = 41
if (r3 == 0)
  x = 42
r1 = x
y = r1

Thread 2:
r2 = y
x = r2

Behavior in question: r1 == r2 == r3 == 42

Proposed Decision: Disallowed. (See Test 18 which is currently allowed.)


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