On Aug 6, 2013, at 8:39 AM, Nick Rogers <[email protected]> wrote:

> 1. Created a mutable array in main thread, can I read its values in a 
> secondary thread safely, while no other thread is modifying this mutable 
> array?

Yes. Most non-thread-safe objects don’t care what threads you call them on, so 
long as they’re only called on one thread at a time. So you can use locks or 
@synchronized blocks to coordinate access.

(The exceptions are higher-level things that use runloops or dispatch queues, 
such as NSURLConnection, NSStream, etc. Those usually need to be called only 
from the same thread/queue they’re scheduled on, because they’re also getting 
callbacks on that same thread/queue.)

—Jens
_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to