Re: observing dealloc
Re: observing dealloc
- Subject: Re: observing dealloc
- From: Erik Buck <email@hidden>
- Date: Mon, 28 May 2007 18:46:25 -0400
Your posted code is completely not thread safe. Every single method
is a threading disaster waiting to happen.
Here is a hint: If you use the words "global" or "static" or
"shared", you are going to need some form of concurrent access
protection (a mutex, semaphore, etc.).
Just scanning your code, I note that there are no bottle necks
through which gGlobals and gCounters are accessed. That is bad form
in any case, but if you seriously contemplate multi-threading, you
are frankly in deep trouble.
What are you really trying to accomplish? "add globals to any class"
is a very strange goal. Why would you want to add "globals" to any
class; that doesn't even make any sense? Is English your first
language ? Do you really mean "have global instances of any
class" ? Has anyone ever suggested to you that using globals might
not be the best approach ?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden