RE: JavaMemoryModel: Tiger beta1 ConcurrentHashMap bug?

From: David Holmes (dholmes@dltech.com.au)
Date: Wed Apr 07 2004 - 23:53:54 EDT


Doug Lea wrote:
> class C {
> volatile Object v;
> final Object f;
> C(Object a, Object b) {
> v = a;
> f = b;
> }
> }
>
> Assuming a is nonnull, you might think there isn't any way that any
> thread could see c.v == null for any instance c. But the model allows
> it.

Is this just the "normal" case where an inlined constructor could allow
publishing of the object reference prior to the completion of the
constructor?

David Holmes

-------------------------------
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