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


References: 
 >Re: pointer assignment inherently atomic ? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Watching folders for new files and event handling based on that?
  • Next by Date: Re: Watching folders for new files and event handling based on that?
  • Previous by thread: Re: pointer assignment inherently atomic ?
  • Next by thread: Overlay view drawing woes
  • Index(es):
    • Date
    • Thread