The Java memory model described in Chapter 17 of the Java Language Specification
gives constraints on how threads interact through memory.
The Java memory model is hard to interpret and poorly understood;
it imposes constraints that prohibit common compiler optimizations
and are expensive to implement on existing hardware. At least one
shipping optimizing Java compiler violates the constraints
of the existing Java memory model. These issues are particularly important
for high-performance Java applications, since they are more likely
to use and need aggressive optimizing compilers and parallel processors.
In addition, programming idioms used by some programmers and
used within Sun's Java Development Kit is not guaranteed to
be valid according the existing Java memory model.
This paper reviews these issues and suggests
replacement memory models for Java.