Concurrency Kit (libck) supplies C99+ lock-free queues, stacks, hash sets, memory reclamation, spinlocks, and barriers for high-performance concurrent systems.
Overview
Concurrency Kit is a C library collection aimed at researchers and engineers building high-performance concurrent software. It packages concurrency primitives, safe memory reclamation schemes, non-blocking data structures, and a wide range of synchronization primitives in one installable libck build.
Primitives include compare-and-swap wrappers, backoff helpers, and compiler-specific utilities. Memory reclamation covers epoch-based and hazard-pointer mechanisms intended for lock-free algorithms. Data structures range from concurrent rings, FIFOs, stacks, bitmaps, and hash tables to BSD-queue derivatives designed for read-heavy workloads.
Synchronization modules provide spinlocks, MCS and CLH variants, reader-writer locks, barriers, event counters, lock cohorting for NUMA, and optional hardware lock elision helpers where transactional memory exists. Many components are reference implementations of published algorithms with specialization for bounded or single-threaded roles.
Supported platforms include specialized assembly for architectures such as aarch64, arm, x86, x86-64, ppc, riscv64, and others, with compiler intrinsics as a slower fallback. Users configure with ./configure, build with make, and install with make install on POSIX-like systems exercised in continuous integration on Darwin and Linux.
Key features
- Lock-free FIFOs, stacks, and rings
- Epoch and hazard-pointer reclamation
- Concurrent hash sets and tables
- MCS, CLH, and ticket spinlocks
- Reader-writer and phase-fair locks
- Execution and combining barriers
- Architecture-specific assembly paths
- configure and make install workflow
Use cases
- Lock-free server data structures
- Research on concurrent algorithms
- NUMA-aware locking experiments
- High-throughput C services