Results 1 to 2 of 2
- 09-07-2011, 05:42 AM #1Member
- Join Date
- May 2011
- Rep Power
Is a singleton a singleton only in one process or across processes?
Say I have a singleton in a library jar file and I use it in multiple programs. When I start the multiple programs as different processes, each process would have their own copy of the singleton, am I correct to say that? (i.e. the singleton is not shared across multiple processses)
- 09-07-2011, 07:08 AM #2
Re: Is a singleton a singleton only in one process or across processes?
My initial thought is that each process would get its own Singleton instance. Why not write some code to test it out. Create a Singleton class. Create 2 other classes that each create an instance of the Singleton. Run both classes and see if both can instantiate the Singleton.
- By dardar in forum New To JavaReplies: 2Last Post: 09-20-2010, 11:15 AM
- By piyu.sha in forum New To JavaReplies: 2Last Post: 10-06-2008, 10:06 PM
- By haiforhussain in forum Advanced JavaReplies: 8Last Post: 06-23-2008, 07:43 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 01:41 PM
- By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 09:32 PM