Comment on Correctly implementing a spinlock in Modern C++Comments−RcouF1uZ4gsC5yI think it may become even easier with C++20 and the addition of wait/notify to std::atomichttps://en.cppreference.com/w/cpp/atomic/atomic/wait−Kranar5yThat is a great way to implement a lock, but it won't be a spin lock (which is a good thing by the way). The wait function is a blocking call.
Comments
I think it may become even easier with C++20 and the addition of wait/notify to std::atomic
https://en.cppreference.com/w/cpp/atomic/atomic/wait
That is a great way to implement a lock, but it won't be a spin lock (which is a good thing by the way). The wait function is a blocking call.