Stylized circular ringbuffer with producer and consumer pointers.

Designing Lock-Free Queues: Inside the Linux KFIFO and Ringbuffer Implementations

How the Linux kernel’s KFIFO achieves a wait-free, lock-free FIFO with a single atomic variable. We walk through the ringbuffer math, the memory-ordering subtlety that makes it correct on weakly ordered CPUs, and what you can borrow for your own high-throughput pipelines.

September 6, 2026 · 14 min · 2883 words · martinuke0
Illustration of intertwined gears representing lock‑free concurrency.

Hidden Memory Hazards in Lock-Free Data Structures

A deep dive into hidden memory hazards in lock‑free structures, with examples, diagnostics, and mitigation techniques for reliable concurrent code.

May 17, 2026 · 9 min · 1708 words · martinuke0
Illustration of overlapping epochs in concurrent memory reclamation.

How Epoch-Based Reclamation Avoids the Stalled Pointer Problem

A deep dive into epoch‑based reclamation, showing why it solves the stalled pointer issue and how to apply it safely in high‑performance concurrent code.

May 17, 2026 · 9 min · 1803 words · martinuke0
Illustration of a circular buffer with atomic pointers.

The Mechanics of Thread Safety in Lockless Circular Buffers

A deep dive into lockless circular buffer design, showing how atomic primitives, memory fences, and careful indexing keep multiple producers and consumers safe without locks.

May 15, 2026 · 10 min · 1918 words · martinuke0
Illustration of a binary heap with atomic arrows indicating lock‑free operations.

Implementing Lock-Free Priority Queues Using Compare and Swap

A deep dive into lock‑free priority queues, explaining the compare‑and‑swap technique, data‑structure choices, correctness proofs, and real‑world benchmarks.

May 15, 2026 · 10 min · 2000 words · martinuke0
Feedback