in Operating System retagged by
896 views
2 votes
2 votes
Consider a non-negative counting semaphore S. During an execution, 16P (wait) operations, and 4V (signal) operations are issued in some order. The largest initial value of S for which at least three up operations will remain blocked is ___________

 

Can someone explain me the solution
in Operating System retagged by
896 views

4 Comments

Your ans. is correct. But why did you took -3 in RHS instead of +3
0
0
-3 indicating that 3 processes are in the block state.

For ex - Let's take the value of counting semaphore = 10. (10 processes can be in the critical section)

If we have 12  processes then the value of counting semaphore will 10 -12 = -2 ( that means two process is in the critical section ).
0
0
question says 3 up operation remain blocked thats why -3 if it would have asked for 3 operation remain blocked then we would have used +3. @pavan shetty
0
0

1 Answer

0 votes
0 votes
Assume Semaphore value as S

so according to question S-16(down operation) + 4(up operation)  <=  -3(here  – sign denotes number of process waiting in ready queue)

thus  S<=9   hence largest value of S is 9.