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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to