This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes any singleton pattern early instantiated issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "any singleton pattern early instantiated issues" Watch "any singleton pattern early instantiated issues" New topic
Author

any singleton pattern early instantiated issues

Krishnaa Kumar
Greenhorn

Joined: May 05, 2011
Posts: 25
I came across some issues using lazy instantiated singleton pattern

Reference: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html.

Similarly is there any issues in using early instantiated singleton pattern?
Nomaan Butt
Ranch Hand

Joined: Oct 19, 2011
Posts: 54
Krishnna,
Below text from the link mentioned by you above specifies that issues with lazy initialization of singletion have been taken care off.
JDK5 and later extends the semantics for volatile so that the system will not allow a write of a volatile to be reordered with respect to any previous read or write, and a read of a volatile cannot be reordered with respect to any following read or write




 
 
subject: any singleton pattern early instantiated issues
 
Similar Threads
running only one instance of java program
How does Spring framework handle Singleton in its implementation?
Anti-patterns - Singleton.
Problems referencing singleton across frames
Singleton Pattern Vs All Static Methods