Boost logo

Boost :

Subject: [boost] boost.atomic and boost.lockfree backports
From: Bryce Lelbach (blelbach_at_[hidden])
Date: 2011-05-28 18:52:40

Hartmut and I have been using modified versions of Boost.Lockfree and
Boost.Atomic in our codebase at work. I've put git repositories of our versions
of both libraries up on github, so that the lockfree/atomic authors can integrate
our bug fixes and/or feature extensions if they wish. The code is under the BSL.

In addition to a number of bug fixes/tweaks, our variants contain the following

  * boost.atomic: 128bit lockfree atomics for MSVC 2008+ (using
    _InterlockedCompareExchange128 and SSE2 intrinsics) and GCC-compatible POSIX
    compilers (using 16 byte __sync intrinsics). This code is x86-64 specific,
    and disabled by default. Define BOOST_ATOMIC_HAVE_SSE2 to enable in x86-64
    MSVC 2008+ environments. Define BOOST_ATOMIC_HAVE_SSE2,
    for GCC-compatible compilers. The following command line flags are also
    needed for GCC-compatible compilers: -mcx16 (enables 16byte sync intrinsics)
    and -msse2.

  * boost.lockfree: A growable lockfree deque, based on algorithms by
    M. M. Michael. Backed by 128bit atomics. This is the first lockfree data
    structure I've written, so take it with a grain of salt. There's one bug
    that I'm aware of, unfortunately, it occurs infrequently so I haven't had
    much luck tracking it down.


P.S. I don't have a list of the specific bug fixes on hand, I'll have to go
through the SVN logs for that. The only non-trivial one that I know of is the
problem with intel-linux that I found and fixed (intel doesn't define *amd64*
macros, and they were used for x86-64 bit detection).

Bryce Lelbach aka wash

Boost list run by bdawes at, gregod at, cpdaniel at, john at