File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: any singleton pattern early instantiated issues
 
Similar Threads
Anti-patterns - Singleton.
Problems referencing singleton across frames
Singleton Pattern Vs All Static Methods
How does Spring framework handle Singleton in its implementation?
running only one instance of java program