JavaMemoryModel: A Better Way?

From: David F. Bacon (
Date: Mon Sep 11 2000 - 17:39:32 EDT

Discussion on this list has focused on short-term solutions to the problems
with Java's memory model. Rob Strom, Ashis Tarafdar, and I have pursued a more
radical approach which involves eliminating the need for Java's highly complex
(and error-prone) semantics for unregulated concurrent access to memory. The
paper will appear in OOPSLA, and is available at

I've enclosed the abstract below. We'd welcome any feedback from this group,
either via this list, by personal communication, or at OOPSLA.



TITLE: Guava: A Dialect of Java without Data Races
AUTHORS: David Bacon, Rob Strom, Ashis Tarafdar


We introduce Guava, a dialect of Java whose rules statically guarantee that
parallel threads access shared data only through synchronized methods. Our
dialect distinguishes three categories of classes: (1) monitors, which may be
referenced from multiple threads, but whose methods are accessed serially; (2)
values, which cannot be referenced and therefore are never shared; and (3)
objects, which can have multiple references but only from within one thread,
and therefore do not need to be synchronized. Guava circumvents the
problems associated with today's Java memory model, which must define behavior
when concurrent threads access shared memory without synchronization.

We present an overview of the syntax and the semantic rules of Guava. We
discuss how implementations of Guava can exploit these rules to re-enable
compiler optimizations inhibited by standard Java. We discuss how compilers
for certain multiprocessor architectures can automatically generate certain
programming idioms, such as double-check reads, as optimizations of serialized
JavaMemoryModel mailing list -

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