|
If you need to use lazy initialization for performance on a static field, use the initialize-on-demand holder pattern. This pattern takes advantage of the guarantee that a class will not be initialized until it is used :
References and More Information:
Effective Java, Second Edition by Joshua Bloch
Java Concurrency in Practice by Brian Goetz
Robust and Scalable Concurrent Programming: Lessons from the Trenches
Concurrency: Past and Present
http://weblogs.java.net/blog/car ... va-concurrency-tips |
|