@amiloradovsky @cwebber
My understanding is the x86 processor implements only CAS, and everything else is built using that.
You want a lock? You use CAS to set <memory_location> to 1 if and only if it's currently 0
Other processors use different techniques, one is called "acquire and release". I don't understand this stuff very well but you can find some discussion of pros and cons of these in the RISC-V spec and more by info searching "memory consistency models"