C++ how to replace mutex code with CAS ( compare and exchange ) ( lock-less programming )
It is well known that if mutex protected codes could potentially be replaced by atomic compare exchange, thus we cab achieve lock-less programming. In practice, it may need several techniques…