Concurrency Kit (ck) Documentation

repository·master·Indexed 25 days ago

https://github.com/concurrencykit/ck

A library of modern concurrency primitives and building blocks for high-performance applications. It provides optimized data structures, synchronization primitives, and safe memory reclamation mechanisms such as Epoch-based reclamation and Hazard Pointers. Features include lock-free arrays, bitmaps, rings, FIFOs, stacks, queues, and hash sets, as well as specialized assembly optimizations for architectures including x86, x86_64, aarch64, arm, ppc, ppc64, riscv64, s390x, and sparcv9+.

Tokens
455
Snippets
1
Records
3
Agent score
33%

What's inside Concurrency Kit

  1. Overview of Concurrency Kit features

    master

    Concurrency Kit provides high-performance concurrency primitives and building blocks. Key feature areas include:

    • Concurrency Primitives: Architecture-specific primitives (ck_pr), backoff functions (ck_backoff), and compiler builtin abstractions (ck_cc).
    • Safe Memory Reclamation (SMR): Scalable mechanisms like Epoch-based reclamation (ck_epoch) and Hazard Pointers (ck_hp).
    • Data Structures: A wide range of lock-free and concurrent structures including arrays (ck_array), bitmaps (ck_bitmap), rings (ck_ring), FIFOs (ck_fifo, ck_hp_fifo), stacks (ck_stack, ck_hp_stack), queues (ck_queue), and hash sets (ck_hs, ck_ht, ck_rhs).
    • Synchronization Primitives: Various locks and synchronization tools including spinlocks (ck_spinlock and its variants), reader-writer locks (ck_rwlock, ck_brlock, ck_pflock), barriers (ck_barrier), and NUMA-friendly cohorting interfaces (ck_cohort, ck_rwcohort).
  2. Compile and build Concurrency Kit

    master

    To build Concurrency Kit from source, follow these steps using the provided Makefile system:

    1. Configure: Run the configuration script. You can use ./configure --help to see available options.
    2. Build:
      • To build the library (libck), run make or make all.
      • To compile regressions (requires POSIX threads), run make regressions.
    3. Install/Uninstall:
      • To install the library to the system, run make install.
      • To remove the installation, run make uninstall.
    ./configure
    make
    make install
  3. Supported Architectures

    master

    Concurrency Kit supports any architecture using compiler built-ins as a fallback (though this may result in performance degradation). It includes specialized assembly optimizations for the following architectures:

    • aarch64
    • arm
    • ppc
    • ppc64
    • riscv64
    • s390x
    • sparcv9+
    • x86
    • x86_64