0
In a producer-consumer problem solved using semaphores empty, full, and binary semaphore mutex, what would happen if both the producer and consumer acquired wait(mutex) before wait(empty)/wait(full) respectively (instead of after)?
- ANo difference in behaviour
- BIt could lead to a deadlock, e.g. when the buffer is full and the consumer is waiting for mutex held by a blocked producer
- CIt would make the solution faster
- DIt would eliminate the need for the mutex semaphore
Correct answer: B