Re: Multiple singletons
Re: Multiple singletons
- Subject: Re: Multiple singletons
- From: Daniel Jalkut <email@hidden>
- Date: Mon, 27 Jun 2005 12:55:30 -0700
Unless you go out of your way to make your singletons cross-process,
then they will be restricted to the address space of the application
that is hosting them.
One thing worth noting with regard to singletons: always use a
"static global" for the singleton variable, and/or name the variable
uniquely for each singleton class. I recently ran into a mysterious
error which turned out to be due to my carelessly defining two
singleton classes, each with a "gSharedInstance" global. Imagine my
surprise when the wrong singleton was returned!
Daniel
On Jun 27, 2005, at 12:17 PM, Ken Tozier wrote:
I'm designing a singleton class that could potentially be useful in
other applications and was wondering, is the scope of a singleton
system-wide, or only within whichever app(s) that use it? Or put
another way, can a singleton class be used in an application
without stomping on another instance of the same singleton in
another app?
Thanks
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden