The atomic_ops project

As of February 2014, this page is no longer maintained. The files found
here may still be useful. For more recent versions of this package,
see
the GitHub repository. If you are using only C11 or C++11 (or later)
compilers, you should almost certainly be using the atomic operations
provided by those languages instead.

The most recent version of this package can be found in the
source tree for the
Boehm-Demers-Weiser garbage collector (bdwgc) on Github.
It should be possible to just extract the libatomic_ops source tree
and build it independently.
Recent versions are identified by bdwgc
version numbers.

Provides implementations for atomic memory update operations on a number of
architectures. This allows direct use of these in reasonably portable code.
Unlike earlier similar packages, this one explicitly considers memory
barrier semantics, and allows the construction of code that involves
minimum overhead across a variety of architectures.

The package has been at least minimally tested on X86, Itanium, Alpha,
PA-RISC, PowerPC, and SPARC, with Linux,
Microsoft Windows,
HP/UX, Solaris,
and MACOSX operating systems. Some implementations are more complete
than others.

It should be useful both for high performance multi-threaded code which
can't afford to use the standard locking primitives, or for code that
has to access shared data structures from signal handlers. For details, see
README.txt
in the distribution.

Note that experience with this package contributed to the design of C11 and
C++11 atomics, which represent a careful refinement of the API. If your
platform supports well-implemented C11 or C++11 atomics, please use
those instead.