Re: JavaMemoryModel: Word tearing

From: Doug Lea (dl@altair.cs.oswego.edu)
Date: Thu Jan 03 2002 - 16:01:17 EST


> Second, you can't declare an array as volatile. You can only declare
> a field that stores a reference to an array as volatile, and that
> field will typically only be written once. So declaring the field as
> volatile doesn't do anything useful to force visibility between the
> threads.

Oh, sorry; now I remember how this goes. Since you cannot declare
array elements as volatile, you would need auxiliary volatile
variables to communicate changes. Which means that my premise is all
wrong here.

I don't want to allow word-tearing either. I just wanted to make sure
that there's an answer to this question. And I now see that the answer
has to be: "it just works".

So, never mind...

-Doug

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



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