Re: JavaMemoryModel: JMM problems with latch or copy-on-write?

From: David Smiley (dsmiley@mitre.org)
Date: Thu Mar 29 2001 - 13:40:28 EST


> > Will some thread B calling getLength() ever see [unexpected] results?
>
> It's possible.

    Oooo, that's just nasty! Are all of you "okay" with this proposed
behavior? ISTM (it seems to me) that to get any use out of volatile, you'd
have to declare nearly every member of a potentially shared class as
volatile. blech!

> Volatiles only preserve their assignment order with other volatiles and
> synch blocks, not with assignments to every field in every object
(including
> the object in which the volatile is declared).

    Why not further define the semantics of volatile to declare that
non-volatile accesses cannot be re-ordered amongst volatile accesses? Is
that not much more reasonable and useful? If not then volatile is
practically useless.

-- Dave Smiley

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



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