Read, compute, swap only if nothing changed, else retry: a counter without a lock. Then the ABA problem.
This interactive visualization needs JavaScript.