All mock tests are FREE till 31 December — register to save your progress

At a particular time of computation, the value of a counting semaphore is 10. Then 12 P operations and “x” V operations were performed on this semaphore. If the final value of semaphore is 7, x will be :

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 9

Explanation

Each P subtracts 1 and each V adds 1: 10 − 12 + x = 7, so x = 9.

More System Software and Operating System questions