JavaMemoryModel: Legal implementations

From: William Pugh (
Date: Fri Jul 06 2001 - 11:02:22 EDT

At 5:38 PM -0500 6/29/01, Sarita Adve wrote:
> >
>> Reordering a monitorexit and a finite number of volatile reads may
>> fall into the category of something that is illegal in the semantics,
>> but can't be observed so is legal in the implementation.
>This really should not be an issue. The *semantics* should be specified in a
>way that all implementations are legal. (Hence the previous suggestion of
>giving up on per-process orderings as a way to specify the semantics.)

Clearly, you don't want something such that all possible
implementations are legal (e.g., implementations that ignore the
volatile annotation and keep volatile variables in registers).

It is only illegal to violate the formal semantics in an
implementation if you can be caught and convicted. In other words, if
the program can exhibit a observed behavior that cannot be explained
by the semantics, the implementation is broken. Otherwise it is
legal, and it doesn't matter what is done under the covers.

JavaMemoryModel mailing list -

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