• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: observing dealloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: observing dealloc
      • From: Ken Tozier <email@hidden>
  • Prev by Date: Re: observing dealloc
  • Next by Date: Re: NSTableColumn 'enabled' binding not in 10.3? Any others?
  • Previous by thread: Re: observing dealloc
  • Next by thread: Re: observing dealloc
  • Index(es):
    • Date
    • Thread