Suppose S and Q are two semaphores initialized to 1. P1 and P2 are two…
2013
Suppose S and Q are two semaphores initialized to 1. P1 and P2 are two processes which are sharing resources.

There execution sometimes lead an undesirable situation called
- A.
Starvation
- B.
Race Condition
- C.
Multithreading
- D.
Deadlock
Attempted by 118 students.
Show answer & explanation
Correct answer: D
Process P1 acquires semaphore S and waits for Q, while Process P2 acquires semaphore Q and waits for S. This circular dependency where each process holds a resource the other needs results in a Deadlock, preventing both from executing their critical sections.
A video solution is available for this question — log in and enroll to watch it.