r/cpp • u/david-alvarez-rosa • Mar 24 '26
Optimizing a Lock-Free Ring Buffer
https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/
106
Upvotes
r/cpp • u/david-alvarez-rosa • Mar 24 '26
View all comments
Show parent comment
2
u/Deaod Mar 24 '26
The benefit is only there when dealing with unknown element sizes, ie. one element takes 8 bytes, the next 24, etc.. This allows you to not have any holes in your buffer that the consumer has to jump over.
This is not relevant for queues that deal with elements of known-at-compile-time sizes.