Skip to content
Rota Nacional

Radar ·

Optimizing an SPSC lock-free ring buffer

The article describes optimizing an SPSC ring buffer, from replacing mutexes with atomics to cache-focused adjustments, and reports performance at each stage.

The article follows the optimization of a single-producer, single-consumer (SPSC) ring buffer: it starts with mutexes, moves to atomics, and explores cache-focused adjustments. It reports performance at each stage and discusses memory-ordering changes and reducing cache-line ping-pong.

The material highlights how synchronization choices and cache-line contention affect this type of buffer's performance. To verify the results, consult the original article and compare the conditions and measurements described at each stage; the information provided in this summary does not specify figures or test configurations.

Get new articles

Privacy, AI engineering and security in your inbox.

Rota Nacional

Bring privacy into your workflow.

30 days, no card, with a starting quota. After that, Pix credit from R$ 5,00.

Try free