Subject: Is Singleton thread safe? 2005-04-01 - By Darryl Pierce
Back On Apr 1, 2005 10:54 AM, Julia Liu <julialiu@(protected)> wrote: > Is Singleton thread safe? Why?
As with any object, it's thread-safe if either it's immutable (i.e., if it has no setter methods for its instance values) or if the methods which alter its stateful information are synchronized or it updates its state in a synchronized manner.
-- Darryl L. Pierce <mcpierce@(protected)> Visit the Infobahn Offramp: <http://mcpierce.mypage.org> "Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|