ISRO | ISRO CS 2017 | Question 70
A counting semaphore was initialized to 7. Then 20 P (wait) operations and x V (signal) operations were completed on this semaphore. If the final value of semaphore is 5, then the value x will be
Explanation: In semaphores, P operation means wait operation and it decrements the value of the counting semaphore by 1 whereas V operation means signal operation and it increments the value of the counting semaphore..
Here a counting semaphore S = 7
After 20 P operations , s = 7-20 = -13
After ‘x’ V operations value of S=5, So -13 + xV = 5 and S = 18 .
Option C is correct.
Quiz of this Question