RE: JavaMemoryModel: Performing speculative writes ahead of loops that may not terminate

From: David Holmes (dholmes@dltech.com.au)
Date: Sun May 30 2004 - 20:08:30 EDT


Sylvia Else wrote:
> I don't see the problem.

There isn't one, as long as the write to workerFinished is not moved to
before the loop.

My query is whether the JMM as it stands forbids that movement. The original
example involved no volatile accesses, Eliot Moss sought verification that
if the write was to a volatile and another volatile access occurred in the
loop, then the move would not be allowed. I was showing that even if there
are no volatile accesses in the loop, if the write is to a volatile then the
move must not be allowed.

David Holmes

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



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