Results 1 to 2 of 2
  1. #1
    guest_user is offline Member
    Join Date
    May 2011
    Posts
    47
    Rep Power
    0

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

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,762
    Rep Power
    7

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

Similar Threads

  1. Singleton
    By dardar in forum New To Java
    Replies: 2
    Last Post: 09-20-2010, 10:15 AM
  2. Replies: 2
    Last Post: 10-06-2008, 09:06 PM
  3. singleton object ...
    By haiforhussain in forum Advanced Java
    Replies: 8
    Last Post: 06-23-2008, 06:43 AM
  4. Replies: 0
    Last Post: 03-29-2008, 12:41 PM
  5. Replies: 0
    Last Post: 09-26-2007, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •