edited by
22,838 views
30 votes
30 votes

Which of the following is not a valid deadlock prevention scheme?

  1. Release all resources before requesting a new resource.
  2. Number the resources uniquely and never request a lower numbered resource than the last one requested.
  3. Never request a resource after releasing any resource.
  4. Request and all required resources be allocated before execution.
edited by

2 Answers

Best answer
41 votes
41 votes

The answer is (C).

  1. is valid. Which dissatisfies Hold and Wait but ends up in starvation.
  2. is valid. Which is used to dissatisfy circular wait.
  3. is invalid.
  4. is valid and is used to dissatisfy Hold and Wait.
edited by
2 votes
2 votes
Option A is valid, it will help to violate hold and wait condition. Whenever you request a new resource you release all the previously acquired resources.

Option B is Valid, it is the standard method used for removing circular wait.

Option D is valid, it will also remove Hold and Wait condition.

Hence, option C is the invalid option. And it is invalid also because if you release the resource, some or the other process will be able acquire it and complete execution. Hence, the process can request for a new resource without causing deadlock.
Answer:

Related questions

10.2k
views
4 answers
31 votes
Kathleen asked Sep 14, 2014
10,150 views
a. Fill in the boxes below to get a solution for the reader-writer problem, using a single binary semaphore, mutex (initialized to $1$) and busy waiting. Write ... 0; signal (mutex); }b. Can the above solution lead to starvation of writers?
23.0k
views
7 answers
48 votes
Kathleen asked Sep 14, 2014
22,987 views
Let $m[0]\ldots m[4]$ be mutexes (binary semaphores) and $P[0]\ldots P[4]$ be processes. Suppose each process $P[i]$ executes the following: ... (m(i+1) mod 4]);This could causeThrashingDeadlockStarvation, but not deadlockNone of the above
11.6k
views
1 answers
21 votes
Kathleen asked Sep 14, 2014
11,552 views
A graphics card has on board memory of $1$ MB. Which of the following modes can the card not support?$1600 \times 400$ resolution with $256$ ... inch monitor$800 \times 800$ resolution with $256$ colors on a $14$ inch monitor
19.0k
views
4 answers
64 votes
Daggerhunt asked Nov 16, 2014
19,024 views
Let $G$ be an undirected graph. Consider a depth-first traversal of $G$, and let $T$ be the resulting depth-first search tree. Let $u$ be a vertex in $G$ and let $v$ ... not an edge in $G$ then $u$ and $v$ must have the same parent in $T$