Operating System

1:

At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and 'x' V operations were completed on this semaphore. If the final value of the semaphore is 5, x will be

A.

22

B.

18

C.

15

D.

13

 

Answer : B

Explanation :

Each P operation will decrease the semaphore value by 1 and V operation increases by 1.
If x is 18, i.e 18 V operations  on counting semaphore with value 7 will make it 25 .
and 20 P operations will make it 5.
Hence the answer.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.