Machine-translated by Google. Questions are authored in English.
Top

Discussion

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 and T
Process E holds T and wants V
Process F holds W and wants S
Process G holds V and wants U

Are there any processes deadlocked ?

  • A.No process
  • B.Yes, A, B, C
  • C.Yes, D, E, G
  • D.Yes, A, B, F

Answer: C

Yes, D, E and G are deadlocked.

Follow who waits for whom. D holds U and wants T; T is held by E. E wants V, held by G. G wants U, held by D. This gives the cycle D, E, G, D, and since each resource has a single instance, the three are deadlocked.

A and B also want T, so they are blocked waiting for E, but they are not part of the cycle. C and F want S, which nobody holds, so they can proceed. So the processes involved in the deadlock are D, E and G, which rules out 'no process' and the sets containing A, B, C or F.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.