Re: JavaMemoryModel: Weak fairness in the Java memory model

From: Sylvia Else (
Date: Tue Apr 13 2004 - 23:21:35 EDT

At 02:55 PM 13/04/2004 -0400, Bill Pugh wrote:
>OK, we're going to have to adjust this.
>Jeremy, Sarita and I are working on something, give us another day
>or so to sanity check it.
>The intent is still the same:
>* Not require any thread scheduling fairness
>* Prevent transformations such as hoisting
> a volatile read out of a loop (in the general
> case).
> Bill

Just a general musing from me. It seems that the constraints that apply to
hoisting a volatile read out of a loop should be the same as that for
hoisting any other read out of a loop, and indeed, the same constraint that
applies to merging multiple reads whether volatile or not, into a single read.

This transformation is not permitted if it removes a happens-before
relationship between a write and a read of the same field.

In the case of the volatile read in a loop, hoisting it is permissible if
it can otherwise be proved that they all see the same write anyway.


JavaMemoryModel mailing list -

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