Re: JavaMemoryModel: Use-case for strong volatile

From: Victor Luchangco (Victor.Luchangco@Sun.COM)
Date: Thu Apr 08 2004 - 09:47:07 EDT


Bill,

Did the review documents specifically say that we were
considering different options on this matter? I looked
back at old copies of documents I have, and I don't see
the discussion in the public review document (though I
haven't scoured it carefully), but the community review
document specifically requests feedback about strong vs.
weak causality models.

The fact that some idioms recommended in the public review
document would break is a serious consideration, but not
necessarily one that should trump other things, especially
as we have said all along that this part was subject to
change. And I don't think we will have to worry too much
about "legacy" effects because (a) no one will really look
at the review documents once the final official document
comes out, and (b) only a very small fraction of programs
should be affected by the difference between the strong
and weak interpretation. I think that very few programs
that try to take advantage of guarantees provided by the
strong interpretation (but not by the weak one) will do
so correctly, because, as Sarita pointed out, the simple
"memory barrier" interpretation does not quite work.

The above is not an argument, in and of itself, for the
weak interpretation, just an argument that we should not,
perhaps, be too constrained by what appears in the review
documents, as long as the deviations are "reasonable".
Of course, interpretations of "reasonable" may vary widely.

As I've said before, I prefer the weak interpretation, both
because it gives implementors wider latitude, rather than
requiring them to implement guarantees of dubious benefit,
and because, if we are wrong, it's easier to make the model
stronger than weaker.

                                   Victor
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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