Re: JavaMemoryModel: Idiom for safe, unsynchronized reads

From: Raymie Stata (stata@pa.dec.com)
Date: Fri Jul 02 1999 - 09:51:22 EDT


Every one seems to agree that programs written in a race-free manner
should behave in a sequentially-consistent manner. The controversy is
over whether programs with races that follow some kind of
initialize-then-publish idiom should also behave in a
sequentially-consistent manner.

I've been arguing furiously that we should _not_ support ordering
guarantees for programs that are not race-free. Bill suggested that
we shouldn't focus too much on trying to convince each other but
instead should be trying to generate useful information for the
decision makers who will be changing the JMM semantics. I agree with
this sentiment.

In keeping with this sentiment, I think we should explore more
carefully what is it we might want to support beyond race-free
programming. What exactly is this "synchronize-free,
initialize-then-publish idiom". If the JMM decision makers are going
to consider support for this idiom, we can help them by providing a
good definition for it.

With this in mind, here are some questions. Do extra ordering
guarantees apply only for writes inside constructors or whether they
extend to all writes that occur prior to publishing?
If the former, does that mean the "initialize-then-publish" idiom does not
extend to arrays? If the later, what constitutes "publishing", and do the
extra ordering guarantees apply only to "immutable" objects, or to objects
whose values stop changing after they are published? If they only apply to
immutable objects, can arrays be "immutable" (they aren't by Doug's
definition)?

Raymie
-------------------------------
This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email JavaMemoryModel@cs.umd.edu
To send a request to the list, email majordomo@cs.umd.edu and put
your request in the body of the message (use the request "help" for help).
For more information, visit http://www.cs.umd.edu/~pugh/java/memoryModel



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