← Back to context Comment by JonChesterfield 10 hours ago If it's a power of two, you don't need the branch at all. Let the unsigned index wrap. 5 comments JonChesterfield Reply loeg 10 hours ago You ultimately need a mask to access the correct slot in the ring. But it's true that you can leave unmasked values in your reader/writer indices. dalvrosa 10 hours ago Interesting, I've never heard about anybody using this. Maybe a bit unreadable? But yeah, should work :) mandarax8 8 hours ago See https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff... which takes it even further :) dalvrosa 7 hours ago Nice one! loeg 3 hours ago I believe ConcurrencyKit's impl does this.https://github.com/concurrencykit/ck/blob/master/include/ck_...
loeg 10 hours ago You ultimately need a mask to access the correct slot in the ring. But it's true that you can leave unmasked values in your reader/writer indices.
dalvrosa 10 hours ago Interesting, I've never heard about anybody using this. Maybe a bit unreadable? But yeah, should work :) mandarax8 8 hours ago See https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff... which takes it even further :) dalvrosa 7 hours ago Nice one! loeg 3 hours ago I believe ConcurrencyKit's impl does this.https://github.com/concurrencykit/ck/blob/master/include/ck_...
mandarax8 8 hours ago See https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff... which takes it even further :) dalvrosa 7 hours ago Nice one!
loeg 3 hours ago I believe ConcurrencyKit's impl does this.https://github.com/concurrencykit/ck/blob/master/include/ck_...
You ultimately need a mask to access the correct slot in the ring. But it's true that you can leave unmasked values in your reader/writer indices.
Interesting, I've never heard about anybody using this. Maybe a bit unreadable? But yeah, should work :)
See https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff... which takes it even further :)
Nice one!
I believe ConcurrencyKit's impl does this.
https://github.com/concurrencykit/ck/blob/master/include/ck_...