◄ Wiki / OS
atomic
An operation that happens all at once, with no chance for another thread to interrupt it midway.
An atomic operation is indivisible: other threads see it as either not-yet-done or fully done, never half-complete. This is the foundation of safe concurrency — for example an atomic compare-and-swap (change a value only if it still equals what you expected) is how locks and lock-free structures enforce mutual exclusion. Without atomicity, two threads racing on the same data corrupt it.
See also
- acquire / releaseThe two paired steps of taking and giving back a lock, with memory-ordering guarantees.