3 ms·
> A mutex would be the most trivial example. I don't believe that is possible to implement, in the general case, with only acquire-release. Wait, what? So you'
by dataflow 1y ago
> A mutex would be the most trivial example. I don't believe that is possible to implement, in the general case, with only acquire-release.
Wait, what? So you're saying this spinlock is buggy? What's the bug?
https://en.cppreference.com/w/cpp/atomic/atomic_flag.html https://en.cppreference.com/w/cpp/atomic/atomic_flag.html
- judofyr 1y agoNo, sorry. I was just remembering where I've typically seen sequential consistency being used. For instance, Peterson's algorithm was what I had in mind. Spinlock is indeed a good example (although a terrible algorithm which I hope you haven't seen used in practice) of a mutex algorithm which only requires acquire-release.