Concurrent Data Structures (libcds)
CDS is a C++ template library of lock-free and fine-grained algorithms. It contains a collection of concurrent data structure implementations:
  • Atomic operations with memory ordering support for x86, amd64, Itanium, Sparc processor architectures
  • Safe memory reclamation (SMR) algorithms:
    • Michael's Hazard Pointer
    • Pass-the-Buck SMR
    • Gidenstam's Hazard Pointer with reference counting
  • Data structures - a lot of intrusive and non-intrusive container algorithms for different SMR schemas
  • Synchronization primitives - spin-lock with different back-off technique
  • Michael's memory allocator. See cds::memory::michael::Heap in documentation
The library is mostly header-only with small kernel in .dll (.so) file for core SMR functionality and small set of static data. See online documentation for detailed reference of CDS features.

Supported compilers, operating systems and processor architectures are:
  • MS Visual Studio 2008 + for MS Windows x86 32/64bit
  • GCC 4.3 +
    • Linux: x86 (32bit), amd64 (64bit), IA64 Itanium (64bit)
    • Solaris: Sparc 64bit
    • HP-UX: IA64 64bit
    • FreeBSD: x86 (32bit), amd64 (64bit)
Download the latest libcds version - source code, doxygen-generated documentation and test suite.
License
BSD license
News
[2012.04.17] Version 1.1.0 is available for download.

1. Added: C++11 atomic operations support. The library has been rewritten for using std::atomic class and operations proposed in C++11 Standard. If the compiler does not support the standard <atomic> library, own partial implementation declared in cds/cxx11_atomic.h is used. cxx11_atomic.h contains implementation for lock-free part of C++11 <atomic> header needed for libcds.

2. Changed: the main reclamation cycle ("liberate" function) of cds::gc::PTB memory reclamation schema has been optimized. Previous implementation could lead to unbounded memory consumption under high contention.

3. Changed: the internal structure of cds::intrusive::OptimisticQueue is greatly simplified. The interface of the class is slightly changed.

4. Fixed: some problem with cds::gc::HRC memory reclamation schema that could be the cause of occasional program crash.

5. Fixed: an error in node reclamation algo in queue implementation (MSQueue, MoirQueue, OptimisticQueue). As an result of the error, some items could be lost with memory leaks.

6. Changed: cds::concept namespace and its content has been removed

7. Added support for Microsoft Visual C++ 11 Beta and GCC 4.7