Re: JavaMemoryModel: Code in the JDK that fails under current memory model

From: Joshua Bloch (
Date: Mon Jul 12 1999 - 14:54:17 EDT


>Has anyone put together a list of places
>in the JDK that assume initialization safety?

   Not that I know of. It's used throughout the Java 2 Collections
implementations, for the Collection-views of Maps: we create them lazily the
first time they're used, and we don't bother with the doublecheck, as it
really doesn't matter if they're created more than once.

   Overall, my guess is that these idioms are used quite frequently. I
wouldn't be at all surprised if you dug up ~100 uses in the JDK, or even


This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email
To send a request to the list, email and put
your request in the body of the message (use the request "help" for help).
For more information, visit

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