I'm trying to understand the 'Compare And Swap' operation, briefly called CAS. I found that it has a variant called 'Compare And Set'. They work the same way but the return is different. 'Compare And Swap' returns a value but 'Compare And Set' returns a boolean.
My question is whether they use the same Compare And Exchange (CMPXCHG for x86) instruction on low-level. Are they both implemented by atomic classes in Java ?