• 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: nonatomic vs atomic assign/retain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nonatomic vs atomic assign/retain


  • Subject: Re: nonatomic vs atomic assign/retain
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 06 Sep 2011 09:50:31 -0700

On Sep 6, 2011, at 9:09 AM, Joar Wingfors wrote:

> There's an additional consideration to keep in mind - @synthesized getters use the retain+autorelease pattern which makes local variables acquired from such getters "safer" in certain (unusual) usage patterns.

And considerably more expensive in all cases, since calling a getter now involves messing with retain counts and autorelease pools. It also means the getter method has to contain a whole register-saving preamble and postamble instead of just the couple of instructions to pull out the ivar value.

At the time ObjC-2 was in development there was a debate within Apple about whether to make ‘nonatomic’ be the default, with an ‘atomic’ keyword to enable the safety features. I really wish it had gone that way.

—Jens_______________________________________________

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

  • Follow-Ups:
    • Re: nonatomic vs atomic assign/retain
      • From: Preston Sumner <email@hidden>
References: 
 >nonatomic vs atomic assign/retain (From: Torsten Curdt <email@hidden>)
 >Re: nonatomic vs atomic assign/retain (From: Thomas Davie <email@hidden>)
 >Re: nonatomic vs atomic assign/retain (From: Joar Wingfors <email@hidden>)

  • Prev by Date: Re: using AppKit additions in background threads
  • Next by Date: Re: nonatomic vs atomic assign/retain
  • Previous by thread: Re: nonatomic vs atomic assign/retain
  • Next by thread: Re: nonatomic vs atomic assign/retain
  • Index(es):
    • Date
    • Thread