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
enhancements:

  * 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,
    BOOST_ATOMIC_HAVE_GNU_SYNC_16 and BOOST_ATOMIC_HAVE_GNU_ALIGNED_16 to enable
    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.

Links:

https://github.com/brycelelbach/boost.atomic
https://github.com/brycelelbach/boost.lockfree

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-spirit.com
px.cct.lsu.edu
github.com/lll-project



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk