• 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: cmpxchgl on x86?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cmpxchgl on x86?


  • Subject: Re: cmpxchgl on x86?
  • From: Shantonu Sen <email@hidden>
  • Date: Fri, 24 Jun 2005 08:18:35 -0700


On Jun 24, 2005, at 7:52 AM, David Leimbach wrote:

On 6/24/05, Jonas Maebe <email@hidden> wrote:


On 24 jun 2005, at 16:40, David Leimbach wrote:


Also, there are compare-and-swap routines already in libSystem:

<libkern/OSAtomic.h>

/* Compare and swap.  They return true if the swap occured.
*/
bool    OSAtomicCompareAndSwap32( int32_t oldValue, int32_t newValue,
int32_t *theValue );
bool    OSAtomicCompareAndSwap32Barrier( int32_t oldValue, int32_t
newValue, int32_t *theValue );


Seems a shame to have to include an entire other framework just for a
single assembly instruction :).  It'd be really cool if apple had a
lighter weight wrapper around such lock code :).


libSystem = libc


Note he wants me to use libkern.  Which is it? :)

Both. These functions are implemented in libSystem.


[ssen@ssen]$ nm -g /usr/lib/libSystem.B.dylib  | grep OSAtomicCompareAndSwap32
900ecbe8 T _OSAtomicCompareAndSwap32
900ecbe8 T _OSAtomicCompareAndSwap32Barrier
         U _OSAtomicCompareAndSwap32
         U _OSAtomicCompareAndSwap32Barrier

Shantonu
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >cmpxchgl on x86? (From: Andrew Gallatin <email@hidden>)
 >Re: cmpxchgl on x86? (From: Matt Watson <email@hidden>)
 >Re: cmpxchgl on x86? (From: David Leimbach <email@hidden>)
 >Re: cmpxchgl on x86? (From: Jonas Maebe <email@hidden>)
 >Re: cmpxchgl on x86? (From: David Leimbach <email@hidden>)

  • Prev by Date: Re: cmpxchgl on x86?
  • Next by Date: Re: What's going on with IOATABlockStorage?
  • Previous by thread: Re: cmpxchgl on x86?
  • Next by thread: Re: cmpxchgl on x86?
  • Index(es):
    • Date
    • Thread