Back to browse
A self-balancing skip-list (a.k.a. "splay-list") library in C

A self-balancing skip-list (a.k.a. "splay-list") library in C

by gregburd·May 19, 2026·4 points·0 comments

AI Analysis

●●SolidCozyNiche Gem

Header-only lock-free splay-list in C with MVCC snapshots and epoch-based reclaim.

Strengths
  • Macro-generated type safety mimics C++ templates while staying pure C99/C11.
  • Fraser/Harris algorithm + EBR ensures correct concurrent memory management without GC.
  • Dual ISC/MIT licensing and zero external deps make it trivial to vendor into projects.
Weaknesses
  • Splay rebalancing adds overhead—may underperform plain skip-lists for read-heavy workloads.
  • No Windows support; relies on pthreads and C11 atomics unavailable on older toolchains.
Target Audience

Systems programmers, embedded developers, high-performance C application authors

Similar To

libcds · folly::ConcurrentSkipList · RCU-based lists in Linux kernel

Post Description

A header-only C library implementing a concurrent, lock-free skip-list (specifically, a splay-list: a skip-list with optional adaptive rebalancing). The entire implementation lives in preprocessor macros in include/sl.h that generate type-specific code at compile time, similar to C++ templates.

Similar Projects

AI/ML●●●Banger

Andrej Karpathy's microgpt.py to C99 microgpt.c – 4,600x faster

Pure C99 GPT with SIMD beats Python 4,600x; drop two files into any project.

WizardryZero to One
Ajay__soni
4033mo ago