Re: Thread-safe atomic property for array
Re: Thread-safe atomic property for array
- Subject: Re: Thread-safe atomic property for array
- From: Mike Abdullah <email@hidden>
- Date: Sat, 15 Aug 2015 13:36:02 +0100
> On 15 Aug 2015, at 13:21, Sandy McGuffog <email@hidden> wrote:
>
> What guarantees that the current autorelease cycle doesn’t end in the middle of this code?
If it does end in the middle of this code, that’s something the author of the code is doing specially and must deal with the consequences by themselves. Trying to protect against that in general is futile.
>
> Actually, as I think about it, technically, the [[hostObject myArray] retain] should be wrapped in some kind of lock mechanism itself to make it atomic….
Go back and read the question. The OP explicitly states that this is an atomic property, and they don’t care if the results are a bit out of date. No extra locking required.
_______________________________________________
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