Article 4.1: Atomic Operations
Posted: Wed Sep 15, 2004 12:56 am
Discusssion thread for this specific optimization article.
Forum for Optimizations around Cocoa and Mac OS X
http://www.mulle-kybernetik.com/forum/Optimization/
http://www.mulle-kybernetik.com/forum/Optimization/viewtopic.php?f=14&t=21
Code: Select all
extern SInt32 IncrementAtomic(SInt32 * value);
extern SInt32 DecrementAtomic(SInt32 * value);
extern SInt32 AddAtomic(SInt32 amount, SInt32 * value);
extern UInt32 BitAndAtomic(UInt32 mask, UInt32 * value);
extern UInt32 BitOrAtomic(UInt32 mask, UInt32 * value);
extern UInt32 BitXorAtomic(UInt32 mask, UInt32 * value);
phip wrote:What's the verdict on these functions? Probably not as fast as the roll-your-own versions, since they aren't inlined and would imply a dyld_stub call, right?