JavaMemoryModel: operation reorderings

From: Bill Pugh (pugh@cs.umd.edu)
Date: Wed Jul 28 1999 - 15:22:09 EDT


I've been think ahead past safety guarantees to which operations we
want to allow to be reordered.

I believe that the current JMM spec effectively imposes the following
constraints between lock/unlock operations and read/write operations:

(Current JMM) You may not reorder:
        + A read and a following lock
        * A lock and a following read
        * A lock and a following write
        * A write and a following unlock

Sarita's suggestion (correct me if I'm wrong) is that you may not reorder:
        * A lock and a following read
        * A lock and a following write
        + A read and a following unlock
        * A write and a following unlock

I've used +'s to indicate the differences.

After thinking about it, I think that Sarita's suggestion is a good
basis to start with. But note that it is neither stronger nor weaker
than the existing JMM. It should guarantee Sarita's suggestion that
data race free programs act as though running under SC, and it will
also allow us to do more optimization than the old JMM.

[Whatever we decide for initialization safety, etc., will be on top
of this, so it doesn't have to effect our rules for lock and unlock].

Comments? The rule that under the current JMM you may not reorder a
read and a following lock doesn't seem that useful (and, as usual
when trying to read the chapter 17, it is questionable as to whether
it is there at all).

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