Re: JavaMemoryModel: The Intuition Is the Model - the full model is in this email!

From: Bill Pugh (pugh@cs.umd.edu)
Date: Wed Jul 30 2003 - 13:49:18 EDT


At 6:10 PM -0400 7/29/03, victor.luchangco@sun.com wrote:
>This fix doesn't quite work. Consider, for example, the following:
>
> Initially, X == 0, V == 0 (V is volatile)
>
> Thread 1 Thread 2 Thread 3
>
> X = 1 X = 2 while (V == 0) {}
> V = 1 r2 = X X = 3
> r1 = X
>
> Can we get r1 == 1?

This probably goes without saying, but I believe that it is important
that r1 = 1 not be allowed, since it violations WW-dag consistency.

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



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