350 views
0 votes
0 votes
A counting semaphore was initialized to 17. Then 8P (wait) operations and ‘n’V (signal) operations were completed on this semaphore. Find the value of n if total 14 down operations can be carried out successfully after 8 wait operation and n signal operations?

ans given 5

1 Answer

0 votes
0 votes
Initial Value of Semaphore:17

P operations:8

V operations:n

P operations decrease the value of the semaphore by 1 and V operations increase it by 1.

new value=17-P+V=14(then only 14 down can be carried ot successfully)

17-8+n=14

n=14-9=5

No related questions found