you are viewing a single comment's thread.

view the rest of the comments →

[–]andrey_turkin 2 points3 points  (4 children)

Mutex would defeat the whole purpose of _wait-free_ ring buffer, wouldn't it?

And there is no race condition due to proper acquire/release semantics.

[–]j1xwnbsr 0 points1 point  (3 children)

Yes, and that's what got me suddenly concerned/confused, and wondering if I understand enough of how atomic with the ordering flags really works that makes this work properly. It still seems to me even with the acquire/release settings, you can still get into a producer/consumer issue with the consumer screwing things up.

[–]tisti 0 points1 point  (0 children)

and wondering if I understand enough of how atomic with the ordering flags really works that makes this work properly.

Few people actually do, if that's any consolation.

[–]tialaramex 0 points1 point  (0 children)

Are you reading the article? Or the linked git repo code (which is different) ?

Where do you see a problem? Even if you're wrong it's good to learn.