Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointer assignment inherently atomic ?



On 10.08.2007, at 23:54, Uli Kusterer wrote:
And anyway, you'll need a lock anyway, because someone could be accessing the array from another thread while you're replacing it, and then you'd release it from out under their feet. Also keep in mind that you also have to lock the objects *in* the array if they're mutable and accessed from another thread, or if they could get released on one of the threads.

Errr... not clear enough: What I meant is that you need to lock the object containing the array (so you can change or examine the iVar pointing to the array), the array (so you don't release it while someone else is iterating over it or whatever) and the objects in the array. The latter is not necessary for immutable objects, of course.


Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >pointer assignment inherently atomic ? (From: "Chase" <email@hidden>)
 >Re: pointer assignment inherently atomic ? (From: Uli Kusterer <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.