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.

image.png

There execution sometimes lead an undesirable situation called

  1. A.

    Starvation

  2. B.

    Race Condition

  3. C.

    Multithreading

  4. 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.

Explore the full course: Mppsc Assistant Professor