All programming languages have their share of idioms. Many are useful to know and use, and programmers spend valuable time creating, learning, and implementing them. The problem is that some idioms are later proven not to be all that they w...More
All programming languages have their share of idioms. Many are useful to know and use, and programmers spend valuable time creating, learning, and implementing them. The problem is that some idioms are later proven not to be all that they were purported, or to simply not work as described. Double-checked locking is one such idiom in the Java programming language that should never be used. In this article, Peter Haggar examines the roots of the double-checked locking idiom, why it was developed, and why it doesn't work.
Details on the reasons - some very subtle - why double-checked locking cannot be relied upon to be safe. Signed by a number of experts, including Sun engineers.
www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
-
Get Site Info
JSR 133, which has been active for nearly three years, has recently issued its public recommendation on what to do about the Java Memory Model (JMM). Several serious flaws were found in the original JMM, resulting in some surprisingly diffi...
www.ibm.com/developerworks/library/j-jtp02244.html
-
Get Site Info
Java Concurrency / Multithreading This article describes how to do concurrent programming with Java. It covers the concepts of parallel programming, immutability, threads, the executor framework (thread pools), futures, callables and the fo...
www.vogella.de/articles/JavaConcurrency/article.html
-
Get Site Info
Many Java programmers are familiar with the double-checked locking idiom, which allows you to perform lazy initialization with reduced synchronization overhead. Though many Java books and articles recommend double-checked locking, unfortuna...
www.javaworld.com/jw-02-2001/jw-0209-double.html
-
Get Site Info