Don't miss an insight. Subscribe to Techopedia for free.


Atomic Operation

What Does Atomic Operation Mean?

Atomic operations in concurrent programming are program operations that run completely independently of any other processes.


Atomic operations are used in many modern operating systems and parallel processing systems.

Techopedia Explains Atomic Operation

Atomic operations are often used in the kernel, the primary component of most operating systems. However, most computer hardware, compilers and libraries also provide varying levels of atomic operations.

In loading and storing, computer hardware carries out writing and reading to a word-sized memory. To fetch, add or subtract, value augmentation takes place through atomic operations. During an atomic operation, a processor can read and write a location during the same data transmission. In this way, another input/output mechanism or processor cannot perform memory reading or writing tasks until the atomic operation has finished.

Where data is being used by an atomic operation that is also in use by other atomic or non-atomic operations, it can only exist in either sequential processing environments or locking mechanisms have to be used to avoid data errors. Compare and swap is another method but does not guarantee data integrity for atomic operation results.

The problem comes when two operations running in parallel (concurrent operations) utilise the same data and a disparity between the results of the operations occurs. Locking locks variable data and forces sequential operation of atomic processes that utilize the same data or affect it in some way.


Related Terms