atomic operation
(computer science) An operation that cannot be broken up into smaller parts that could be performed by different processors.
|
Results for atomic operation
|
On this page:
|
(computer science) An operation that cannot be broken up into smaller parts that could be performed by different processors.
An atomic operation in computer science refers to a set of operations that can be combined so that they appear to the rest of the system to be a single operation with only two possible outcomes: success or failure.
To accomplish this, two conditions must be met:
To the rest of the system, it appears that the set of operations either succeeds or fails all at once. No in-between state is accessible. This is an atomic operation.
Even without the complications of multiple processing units, this can be
For example, imagine a single process is running on a computer incrementing a memory location. To increment that memory location:
Now, imagine two processes are running incrementing a single, shared memory location:
but before it can write the new value back to the memory location it is suspended, and the second process is allowed to run:
The second process is suspended and the first process allowed to run again:
This is a trivial example. In a real system, the operations can be more complex and the errors introduced extremely subtle.
For example, reading a 64-bit value from memory may actually be implemented as two
Furthermore, the specific order in which the processes run can change the results, making such an error difficult to detect and debug.
A clever programmer might suggest that a lock should be placed around this "
Most modern processors have some facility which can be used to implement locking, such as an atomic
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
Join the WikiAnswers Q&A community. Post a question or answer questions about "atomic operation" at WikiAnswers.
Copyrights:
![]() | Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved. Read more | |
![]() | Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Atomic operation". Read more |
Mentioned In: