Atomic variables have special "transactional" or "atomic" operations such as getAndSet which allow you to do two operations (like checking the value of a variable, and then setting it), in a transactional/atomic fashion - i.e. the operations (plural) are guaranteed to all succeed or all fail. Atomic variables are usually used in multithreaded sections of code which for performance reasons are avoiding locks such as synchronized blocks
Atomic variables have special "transactional" or "atomic" operations such as
getAndSet
which allow you to do two operations (like checking the value of a variable, and then setting it), in a transactional/atomic fashion - i.e. the operations (plural) are guaranteed to all succeed or all fail. Atomic variables are usually used in multithreaded sections of code which for performance reasons are avoiding locks such as synchronized blocks