• edited by
826 views

1 Answer

1 1 vote

There is no progress as there is a possibility of a DEADLOCK. 

I'll show how.

Suppose the buffer is empty.

Then empty=N and full=0

Suppose producer runs first and it runs till the line down(empty) and then it got preempted.

Now the consumer runs.

Mutex was initially 1

Down(Mutex) makes it 0

Down(full) suspends the consumer as full is 0

Now the producer runs again. When it executes down(mutex) it gets suspended too.

--->>Producer and consumer both are suspended-->>Deadlock---> No Progress 

Position:
Show:

Related questions

3 3 votes
1 1 answer
1.8k
1.8k views
Rishabh Gupta 2 asked Jan 23, 2018
1,761 views
Consider two processes P1 and P2 accessing shared variable ‘x’ and ‘y’ protected by two binary semaphores Sx and Sy respectively both initialized to 1. ‘wait’ and ‘signal...
3 3 votes
1 1 answer
1.4k
1.4k views
shaz asked Jan 16, 2019
1,434 views
Consider the below code for synchronizing the classical readers and writers. int rc = 0; int c = 0; Semaphore mutex =1; Semaphore db =1; void Reader(void) { L1: down (mut...
1 1 vote
0 0 answers
1.1k
1.1k views
snaily16 asked Jan 12, 2019
1,102 views
Fails to Guarantee mutual exclusion Guarantee mutual exclusion and prevents deadlockFails to prevent deadlockFails to guarantee mutual exclusion and fails to prevent dead...
2 2 votes
3 3 answers
2.9k
2.9k views
Sambhrant Maurya asked Jan 3, 2019
2,862 views
P1 terminates but P2 does notP2 terminates but P1 does notBoth P1 and P2 terminateNeither P1 nor P2 terminate