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
1
u/LongestNamesPossible Mar 24 '26
I only looked at the linux part and I did learn something, mainly that you can use MAP_FIXED to map a file into already mapped memory space.
I'm not sure how it makes wrapping any easier though, you would still have to wrap after getting to the end of the second buffer.
I'm not sure how it is doing the leap frogging. I'm also not sure that making system calls to mmap multiple times to wrap is going to be easier than checking if an index has reached the end of a buffer.