On Tue, Apr 22, 2008 at 4:37 AM, Paul Thomas <[EMAIL PROTECTED]> 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 (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to