Anonymous user menu

Gate1998_1.31

A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4V (signal) operations were completed on this semaphore. The resulting value of the semaphore is
(a) 0

(b) 8

(c) 10

(d) 12
 

Answer

Discuss

1Comment
Amit Pal @amitpal101
26 Sep 2016 11:47 am

P(wait) decreases the counting semaphore and V(signal) increases the couting semaphores value.
counting semaphore initial value = 10
after 6P , 4V operations = 10 - 6 + 4 = 8
Ans is (b)