r/cpp • • Mar 24 '26

Optimizing a Lock-Free Ring Buffer

https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/
106 Upvotes

58 comments sorted by

View all comments

Show parent comment

2

u/max0x7ba https://github.com/max0x7ba Mar 25 '26

Also another improvement is doing index remapping which means subsequent elements dont share the same cache line.

Original index remapping documentation:

https://github.com/max0x7ba/atomic_queue?tab=readme-ov-file#ring-buffer-capacity