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