Atomicity
|
In computer science, an atomic operation is one that either completes fully, or has no lasting effect.
- In database systems, "atomicity" is one of the ACID properties for transactions. Either all steps in a transaction succeed, or the entire transaction is rolled back; partial completion should never be observed.
- In concurrent programming, an "atomic" operation has the additional property that none of its effects are visible until after it completes. That is, that there are no intermediate states visible to other threads. In database systems, this property is classified separately as "isolation".
- In operating systems, an "atomic" operation is an operation that cannot be interrupted once it has begun. For example, basic machine instructions like add or store are usually guaranteed by the hardware to be atomic. This property can be used to implement locks, a vital mechanism for multithreaded programming.
There are several other unrelated meanings of the word atomic in computing:
- 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 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.
- In other areas of computer science, "atomic" can mean the smallest addressable unit of memory. The byte is typically atomic in this sense.