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

From: Joshua Bloch (jbloch@eng.sun.com)
Date: Mon Jul 12 1999 - 14:54:17 EDT


Bill,

>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
~200.

            Josh

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

To send a message to the list, email JavaMemoryModel@cs.umd.edu
To send a request to the list, email majordomo@cs.umd.edu and put
your request in the body of the message (use the request "help" for help).
For more information, visit http://www.cs.umd.edu/~pugh/java/memoryModel



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