Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Accessing array in thread safe way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing array in thread safe way



On 6 Mar 2012, at 11:51 AM, Jan E. Schotsman wrote:
> I have an array of progress values (number objects) for subprojects, from which I calculate the overall progress .
> The array is an atomic property of the project class.
>
> Is it safe to access this array from multiple threads, using methods like objectAtIndex and replaceObjectAtIndex?

It is safe to access it from multiple threads as long as it is not being changed by any thread during that time. (If it's an immutable array, then you don't have to worry about that.)



_______________________________________________

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: 
 >Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.