Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Understanding C11 and C++11 Atomics

Share this post!
 Vote this!


   The end of 2011 brought new releases of both the C and C++ standards for the first time, with C11 sneaking in just before Christmas. David Chisnall takes a look at one of the more important features added to both standards: atomic operations.
Both the C11 and C++11 specifications contain a new set of atomic types and operations. They're designed to have interoperable semantics, but they don't share quite the same syntax.
Older versions of C and C++ had no support for atomic operations at all. If you're using a GCC-compatible compiler, such as ICC or Clang, you may have come across the _sync_* family of built-in functions, which provide some support. These functions were originally designed for Itanium, so they map quite closely to other operations that are familiar to Itanium users. Everyone else had to use inline (or out-of-line) assembly code for each architecture, or (much more expensive) calls to library functions.


More...

0 comments:

Post a Comment