543 views
0 votes
0 votes

 

1 Answer

0 votes
0 votes

1 semaphore will not be enough because it will act like a critical section entry semaphore and we cant check if buffer is empty or not using only 1 semaphore and also consumer can enter in c.s even when buffer is empty so we need one more semaphore to check status of buffer.

so total we need minimum 2 semaphores for this problem

 

Related questions

0 votes
0 votes
1 answer
1
Mrityudoot asked Jan 27
178 views
Can a counting semaphore acquire a negative value?S = 2;15 P operations done, should the semaphore be 0 or -13
1 votes
1 votes
1 answer
2
0 votes
0 votes
1 answer
3
Na462 asked Jul 14, 2018
683 views