On Jan 29, 2015, at 21:16 , Ken Thomases <k...@codeweavers.com> wrote:
> 
> the getter has to do the equivalent of retain+autorelease atomically

I was thinking that the same would have to be true of local variable accesses, 
too, but I see (if I see) the difference is that references from local 
variables are already retained per-thread, not just per-object.

But now I don’t see how the autorelease got in there. If the getter does the 
retain atomically, then surely it can do the release at its leisure?

The other thing that’s getting in the way is that it seems to me that the 
retain-count *increment* needs to be done atomically, independently of whether 
the retain as a whole is atomic. Otherwise, multi-thread read-only access to a 
variable wouldn’t be safe outside of atomic properties.

_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to