Alex Rivera | Logout

High-level Compare And Swap (CAS) functions?

Asked 2008-09-30T05:16:49.060
13

I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives...

E.g., WIN32 on x86 has a family of functions _InterlockedCompareExchange in the <_intrin.h> header.

Edit
Report

1 Answer

17

I'll let others list the various platform-specific APIs, but for future reference in C++09 you'll get the

atomic_compare_exchange() 

operation in the new "Atomic operations library".

answered 2008-09-30T05:21:44.917

Your Answer