Portable Compare And Swap (atomic operations) C/C++ library?
问题 Is there any small library, that wrapps various processors' CAS-like operations into macros or functions, that are portable across multiple compilers? PS. The atomic.hpp library is inside boost::interprocess::detail namespace. The author refuses to make it a public, well maintained library. Lets reopen the question, and see if there are any other options? 回答1: Intel Threading Building Blocks has a nice portable atomic<T> template which does what you want. But whether it is a small library or