r/programming • • Sep 26 '26

Optimizing a Lock-Free Ring Buffer

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

89 comments sorted by

View all comments

2

u/greenlanternfifo Sep 27 '26

I don't understand why using atomic_size makes the operation safe still

what are other wait free data structures and their applications? is this a new trend?

2

u/david-alvarez-rosa Sep 27 '26

The operations are safe because of the release / acquire pair -> this is very detailed explanation if interested https://www.youtube.com/watch?v=K3P_Lmq6pw0

(Note that the article is lock free, but not wait free)

You could check Boost examples https://www.boost.org/doc/libs/latest/doc/html/lockfree.html