• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: pointer assignment inherently atomic ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointer assignment inherently atomic ?


  • Subject: Re: pointer assignment inherently atomic ?
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 11 Aug 2007 00:04:06 +0200

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:
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>)

  • Prev by Date: Re: Watching folders for new files and event handling based on that?
  • Next by Date: Re: create subimage from NSBitmapImageRep
  • Previous by thread: Re: pointer assignment inherently atomic ?
  • Next by thread: Re: pointer assignment inherently atomic ?
  • Index(es):
    • Date
    • Thread