In computer science, an atomic operation is one that either completes fully, or has no lasting effect. It is a slightly ambiguous term. There is a general usage, and some specialized uses.
Generally, for relational database management systems and transaction processing, ACID stands for Atomicity, Consistency, Isolation, and Durability
- Thus in database systems, Atomicity is one of the ACID properties. In this context, "atomic" means nothing more than the above definition. i.e. All transactions must succeed or the entire transaction is rolled back.
- In other areas of computer science such as operating systems, "atomic" also refers to the property that the changes made by an operation are only visible after it completes. That is, that there are no intermediate states visible to other threads. In database systems, this property is described separately as isolation.
- In operating systems, an Atomic Operation is an operation that cannot be preempted. Once the operation begins, it cannot be interrupted until it is completed. This is necessary to protect data when multithreading or multiprocessing. Critical sections of code are protected by locks with support from hardware.
- In symbolic languages, like Lisp, S-expressions are made of atoms and lists of S-expressions. S-expressions are then atomic if they are atoms, for example, numerics or symbols.
- In other areas of computer science atomic can mean the smallest addressable unit of memory. The byte is typically atomic in this sense.
- In the context of component-based paradigms, atomicity is an element of orthogonality. Possibly guaranteeing hermetic interfaces among components of a component-based system. Malfunctions in one component would result in side-effects in another component . In addition atomicity guarantees that services provided by a component are either offered as a whole, or not at all. Systems built according to this design principle localise the side-effects of changes within the package.