• 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: properties implementation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: properties implementation


  • Subject: Re: properties implementation
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 22 Apr 2008 08:10:23 -0700


On 22 Apr '08, at 6:38 AM, Michael Vannorsdel wrote:

I believe if you use the nonatomic attribute it will be the first example, for atomic it's the second. Atomic is the default if not specified.

And atomic setters are even more complicated, as they incorporate a lock, to avoid race conditions when two threads try to set the property at the same time.


The sad thing is that this makes synthesized property accessors much more expensive than is generally necessary, unless you manually add the "nonatomic" attribute to each one. (I say "generally" because most Cocoa application code isn't multithreaded, and even thread-safe code requires synchronization to be done at a level higher than individual property values, so it probably has its own synchronization code as well.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >properties implementation (From: "Optical Ali" <email@hidden>)
 >Re: properties implementation (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Font-related crash in drawing method on PowerPC machines
  • Next by Date: Re: [Ann] DMG Canvas
  • Previous by thread: Re: properties implementation
  • Next by thread: Re: properties implementation
  • Index(es):
    • Date
    • Thread