| 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
|
|
|