This paper describes alternative memory semantics for Java programs using a
n enriched version of the Commit/Reconcile/Fence (CRF) memory model [16]. I
t outlines a set of reasonable practices for safe multithreaded programming
in Java. Our semantics allow a number of optimizations such as load reorde
ring that are currently prohibited. Simple thread-local algebraic rules exp
ress the effects of optimizations at the source or bytecode level. The rule
s focus on reordering source-level operations; they yield a simple dependen
cy analysis algorithm for Java. An instruction-by-instruction translation o
f Java memory operations into CRF operations captures thread interactions p
recisely. The fine-grained synchronization of CRF means the algebraic rules
are easily derived from the translation. CRF can be mapped directly to a m
odem architecture, and is thus a suitable target for optimizing memory cohe
rence during code generation.