• 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: Using OSMemoryBarrier() with KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using OSMemoryBarrier() with KVO


  • Subject: Re: Using OSMemoryBarrier() with KVO
  • From: "Shawn Erickson" <email@hidden>
  • Date: Tue, 22 Apr 2008 15:15:36 -0700

On Tue, Apr 22, 2008 at 4:37 AM, Paul Thomas <email@hidden> wrote:

>  Is this enough? Or will I need to use a full blown lock?

Yes and no... 1) KVO and multiple thread gets ugly quick, 2) using
NSCondition/Lock may make more sense, 3) using just a volatile BOOL
could be enough depending on how lazy the detection of the ivar can
be, 4) look at using OSAtomicXxxx functions [1].

Note OSMemoryBarrier is just an ordering construct (only really
applicable to PowerPC at this time) not an atomic operation or locking
construct.

-Shawn

[1] <http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafety/chapter_5_section_6.html>
_______________________________________________

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: 
 >Using OSMemoryBarrier() with KVO (From: Paul Thomas <email@hidden>)

  • Prev by Date: Re: Problems with [NSArray count]
  • Next by Date: NSString memory management question
  • Previous by thread: Using OSMemoryBarrier() with KVO
  • Next by thread: Re: Using OSMemoryBarrier() with KVO
  • Index(es):
    • Date
    • Thread