Re: pointer assignment inherently atomic ?
Re: pointer assignment inherently atomic ?
- Subject: Re: pointer assignment inherently atomic ?
- From: Wincent Colaiuta <email@hidden>
- Date: Sat, 11 Aug 2007 02:06:06 +0200
El 10/8/2007, a las 23:42, Scott Ribe escribió:
knowing this, is it possible that pointer assignment will be
effectively atomic even across multiple cores?
You're beyond Cocoa at this point. You should take the question to
Apple's
mt-smp list. I think the answer to your question varies dependent
on the
hardware, especially Intel vs PPC, but mt-smp is the place to go
for an
authoritative answer.
You could use OSAtomicCompareAndSwap32Barrier or
OSAtomicCompareAndSwap64Barrier for this:
<http://developer.apple.com/documentation/Darwin/Reference/ManPages/
man3/OSAtomicAdd32.3.html>
But use of @synchronized is probably simpler (if slower).
Wincent
_______________________________________________
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