concurrencykit/ck logo

concurrencykit/ck

Free

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.

FreeFree tier
Type
Open Source

About concurrencykit/ck

Concurrency Kit (ck) is a C99+ library that provides concurrency primitives, safe memory reclamation mechanisms (epoch-based and hazard pointers), and non-blocking (lock-free) data structures. It includes efficient implementations of concurrent arrays, bitmaps, rings, FIFOs, and stacks, with specialized assembly optimizations for architectures including aarch64, arm, ppc, ppc64, riscv64, s390x, sparcv9+, x86, and x86_64. Designed for high-performance concurrent systems, it supports multiple compilers (gcc, clang, icc, etc.) and platforms, and is widely used in research and production environments.

Key Features

Concurrency primitives (ck_pr, ck_backoff, ck_cc) with architecture-specific support and RTM (transactional memory) wrappers
Safe memory reclamation via epoch-based reclamation (ck_epoch) and hazard pointers (ck_hp)
Concurrent data structures: ck_array, ck_bitmap, ck_ring (bounded FIFO), ck_fifo (lock-free FIFO), ck_stack (Treiber stack)
Specialized assembly optimizations for multiple CPU architectures with fallback to compiler built-ins
Supports gcc, clang, cygwin, icc, mingw32/64, and suncc across various architectures
Continuous integration tested on darwin/clang/arm64, freebsd/clang/x86-64, linux/gcc/arm64, linux/gcc/x86-64, linux/clang/x86-64

Pros & Cons

Pros
  • Comprehensive collection of lock-free and concurrent primitives in a single library
  • Supports both epoch-based reclamation and hazard pointers for memory safety
  • Optimized with custom assembly for major architectures, ensuring high performance
  • Actively maintained with continuous integration across multiple platforms and compilers
  • Open source (free) with a permissive license (MIT, as per GitHub repository)
Cons
  • Steep learning curve for developers unfamiliar with concurrent programming concepts
  • Limited to C99+; no direct support for higher-level languages like C++ or Rust
  • Documentation may be sparse for advanced features; relies on source code and academic references
  • Not an AI tool; primarily a systems programming library

Best For

Developing high-performance concurrent systems in CImplementing lock-free data structures for multi-threaded applicationsSafe memory reclamation in real-time or latency-sensitive systemsResearch and prototyping of concurrent algorithmsBuilding scalable servers and embedded systems requiring deterministic performance

FAQ

What is Concurrency Kit?
Concurrency Kit (ck) is a C99+ library that provides concurrency primitives, safe memory reclamation mechanisms, and lock-free data structures for high-performance concurrent systems.
How do I compile and install Concurrency Kit?
Run './configure' in the root directory, then 'make' to build the library (or 'make regressions' to include tests), and 'make install' to install. Use 'make uninstall' to remove.
What architectures does Concurrency Kit support?
It has specialized assembly for aarch64, arm, ppc, ppc64, riscv64, s390x, sparcv9+, x86, and x86_64. Other architectures fall back to compiler built-ins, though with potential performance degradation.
Is Concurrency Kit free and open source?
Yes, it is open source under a permissive license (MIT) and available for free on GitHub.