JavaMemoryModel: Does everyone agree that volatile variables should be SC

From: Bill Pugh (pugh@cs.umd.edu)
Date: Tue Nov 23 1999 - 12:01:19 EST


Before everyone runs off and changes their compilers to fix the
problem I reported, we should take a moment to verify that we
do want to semantics of volatile variables to be sequentially
consistent.

I will argue that amoung other properties, volatile variables should
be sequentially consistent, for two reasons:

  * It is one of the few places where the old specification was clear

  * It is a simple, clean specification we can describe to people.

However, making volatile variables sequentially consistent will force
memory barriers in places where they are generally not needed (most
uses of volatile variables won't actually require sequential consistency).
But I think this is a cost we can afford to pay.

        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:23 EDT