Bill writes:
> We will allow causality examples 1-3
After some thought, I'm uncomfortable with allowing the inter-thread
analysis that is required to produce the result in case 1.
I think analysis should be strictly intra-thread. (As if there were an
implicit optimization barrier around each thread.) Failing that, I may need
a switch to disable this kind of optimization.
> Causality test case 1:
>
> Initially, x = y = 0
>
> Thread 1:
> r1 = x
> if r1 >= 0
> y = 1
>
> Thread 2:
> r2 = y
> x = r2
>
> Behavior in question: r1 == r2 == 1
The only reason I would allow examples 2 and 3 is because of the following
transformation:
> Thread 1:
> r1 = x
> r2 = x
> if r1 == r2
> y = 1
Equals
> Thread 1:
> r2 = r1 = x
> if r1 == r2
> y = 1
Equals
> Thread 1:
> y = 1
> r2 = r1 = x
-- Joe Bowbeer------------------------------- JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:49 EDT