Lock-free ring buffers are a cornerstone of high-throughput producer-consumer pipelines, yet their performance on modern x86 cores is tightly coupled to cache-line placement and atomic ordering. This paper presents a compact C implementation that pads head and tail indices to separate cache lines, uses relaxed loads with acquire/release fences, and guarantees linearizability under the C11 memory model. We formalize two invariants---capacity preservation and monotonic index progression---and prove that each enqueue and dequeue operation completes in amortized O(1) time while contending only on a single cache line per thread. Empirical measurements on an Intel Core i9-13900HX (Windows 11) confirm the analytical bounds and expose a 12 ns per operation latency under low contention. The
Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.
Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_10_08_lock_free_concurrent_ring_buffer_da,
title={Cache-Line Contention and Atomic Synchronization in a Lock-Free Ring Buffer: An Em...},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-10-08_lock_free_concurrent_ring_buffer_da/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-08_lock_free_concurrent_ring_buffer_da/2026-10-08_lock_free_concurrent_ring_buffer_da.pdf}}
}