Re: JavaMemoryModel: Tiger beta1 ConcurrentHashMap bug?

From: Doug Lea (dl@cs.oswego.edu)
Date: Wed Apr 07 2004 - 15:57:47 EDT


It's been interesting finding cases of code that works on current
implementations but doesn't comply. Here's one:

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.

-Doug

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