2.8k views

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

1. $0$
2. $8$
3. $10$
4. $12$
edited | 2.8k views

Initially semaphore is $10$, then $6$ down operations are performed means $(10-6=4)$ and $4$ up operations means $(4+4=8)$

So, at last option (B) $8$ is correct.

edited by
6 down and 4 up

that mean we are left with 2 down

and the total is 10 reduce 2 down from it

ans 8