Re: JavaMemoryModel: Moving memory operations across external actions

From: Bill Pugh (pugh@cs.umd.edu)
Date: Thu Apr 15 2004 - 13:04:43 EDT


OK, here is a better, more concrete example.

Initially, x = 0

Thread 1:
r1 = readSocket1()
x = 1

Thread 2:
r2 = x
writeSocket2(r2)

Note: readSocket1() will always return 0, unless
there is an earlier write of 1 to socket 2. Because these
are different sockets, their implementation might not
synchronize on any object in common.

Behavior in question: r1 == r2 == 1

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



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