Which of the following is an atomic operation? *
1 point
swap()
test&set()
wait()
None of the options
Answers
Answered by
0
Answer:
swap() operation is not fully atomic operation
but it is atomic
Answered by
0
An atomic operation is as follows:
- From all of the above, only Test & Set can be called an Atomic operation. Test & Set is a kind of instruction that is used to write 1 set to a particular memory location.
- While writing, it returns the old value as a non-interruptible (also called, Single atomic) operation. CPU can use this instruction. Test & Set instructions can also be applied to Software as well.
- Here, these instructions are used with Boolean values, but the function has to be executed atomically.
Similar questions