Consider a system with seven processes A through G and six resources R through…

2016

Consider a system with seven processes A through G and six resources R through W. Resource ownership is as follows :

process A holds R and wants T

process B holds nothing but wants T

process C holds nothing but wants S

process D holds U and wants S & T

process E holds T and wants V

process F holds W and wants S

process G holds V and wants U

Is the system deadlocked ? If yes, ______ processes are deadlocked.

  1. A.

    No

  2. B.

    Yes, A, B, C

  3. C.

    Yes, D, E, G

  4. D.

    Yes, A, B, F

Attempted by 80 students.

Show answer & explanation

Correct answer: C

Answer: Yes — processes D, E and G are deadlocked.

Reason:

  • Key allocations and requests:

    • A holds R and requests T.

    • B holds nothing and requests T.

    • C holds nothing and requests S.

    • D holds U and requests S and T.

    • E holds T and requests V.

    • F holds W and requests S.

    • G holds V and requests U.

  • Identify the circular waits that form the deadlock:

    • D is waiting for T, which is held by E.

    • E is waiting for V, which is held by G.

    • G is waiting for U, which is held by D.

  • Conclusion:

    • The three processes D, E and G form a closed cycle of waiting, so they are deadlocked.

    • Number of deadlocked processes: 3.

    • Other processes (A and B) are blocked waiting for T held by E but are not part of the deadlock cycle; C and F request S which is currently free, so they are not deadlocked.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor