Define Atomic Actions & explain its characteristics
Typically, system activity is governed by the sequence of primitive or atomic operations it is executing. Usually, a machine level instruction, which is indivisible, instantaneous, and cannot be interrupted ( unless the system fails), corresponds to an atomic operation. However, it is desirable to be able to group such instructions that accomplish a certain task and make the group an atomic operation.
Process P1 | Process P2 |
---|---|
— | — |
— | — |
Lock(X) | Lock(X) |
X:=X+Z | X:=X+Y; |
Unlock(X); | Unlock(X); |
— | — |
— | — |
Failure |
[wp_ad_camp_1]
Suppose P1 succeeds in locking X before P2, then P1 updates X and releases the lock, making it possible for P2 to access X. If P1 fails after P2 has seen the changes made to X by P1, then P2 will also have to be aborted or rolled back. It is necessary that P2 should not be able to interact with P1 through X until it can do so safely. In other words, P1 should be atomic. Its effect on X should not be visible to P2 or any other process until P1 is guaranteed to finish. In essence, the effect of P1 on the system(even though it executes concurrently with P2) should look like an undivided and uninterrupted operation.
- Atomic actions extend the concept of atomicity from one machine instruction level to a sequence of instructions or a group of processes that are themselves to be executed atomically
- Atomic actions are the basic building blocks in constructing fault tolerant operations.
- They provide a means to a system designer to specify the process interactions.
[wp_ad_camp_1]
Atomic actions have the following characteristics:
- An action is atomic if the process performing it is not aware of the existence of any other active processes, and no other process is aware of the activity of the process during the time the process performs the action.
- An action is atomic if the process performing it does not communicate with other processes while the action is being performed
- An Action is atomic if the process performing it can detect no state changes except those performed by itself, and if it does not reveal its state changes until the action is complete
- Actions are atomic if they can be considered, so far as other processes are concerned, to be indivisible and instantaneous, such that the effects on the system are as if they were interleaved as opposed to concurrent.