Re: JavaMemoryModel: Deliberate undersynchronization

From: Bill Pugh (
Date: Mon Apr 26 2004 - 14:42:01 EDT

On Apr 24, 2004, at 3:22 PM, Doron Rajwan wrote:

> Except String.hash, is there any other "deliberate
> undersynchronization" in Tiger release?
> Doron.

Doug Lea has some in ConcurrentHashMap. Getting this right was very

There are a bunch of places where the code performs lazy initialization
a primitive value (e.g., hashCode) or of a reference to an immutable
These are generally safe.

FindBugs reports more than 264 cases of inconsistent synchronization.
Undoubtedly, some
of those are false positives, but I'm confident at least 100 of them
are real
synchronization errors. However, I'm not sure they are "deliberate

We also report 95 instances of incorrect double checked locking, and 44
cases of
unsynchronized getter methods that have synchronized set methods. Some
of these
probably overlap with the inconsistent synchronization warnings.


JavaMemoryModel mailing list -

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