> From "The Elements of Java Style", by Allan Vermeulen et al., page 84:
>
> #99. Use the double-check pattern for synchronized initialization.
>
> They give the standard, broken double-check idiom.
>
> This double-check idiom is like a roach infestation. It doesn't
> matter how many of them you crush under your shoe, more of them crawl
> out from under the refrigerator.
Lovely metaphor. Here are a couple of more references for it:
"Java 2 Performance and Idiom Guide", Craig Larman and Rhett Guthrie, p100
"Java in Practice: Design Styles and Idioms for Effective Java", Nigel
Warren and Philip Bishop, p142.
Jeremy Manson
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:27 EDT