993 views
0 votes
0 votes

if c has value =0 initially ....i am getting MAX=2 and minimum =-2..is it correct??

1 Answer

0 votes
0 votes
yes, max =2 and min=-2

bcz,counting semaphore can take any integer value up to the number of process that can enter into critical section or leave the critical section.

that is why here semaphore value max=2 and min =-2(i.e in first case two process entering critical section and in second case two process leaving critical section).

Related questions