The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+17 votes
1.9k views

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.
asked in Operating System by Veteran (59.5k points)
edited by | 1.9k views

1 Answer

+28 votes
Best answer

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.
answered by Boss (19.7k points)
edited by
+37
C is invalid, because it is more like 2 phase locking protocol. Acquire phase & Release phase. We know that even in 2 phase locking deadlock is possible, so C is not really preventing Deadlock. So C is answer. (Adding information as why C is invalid is not present ! )
+4

Actually, C increases the chances of deadlock. You are not allowed to request resources after releasing some resources. So if you require to request some resources and for some of the other resources you have finished your work, What will you do?

You will not release those for which you have finished work and request those you required. So you are holding more number of resources which might be useful for some other process. Increase the chance of deadlock.

0
thanks akash kanase for providing exact approach for option c
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,825 questions
46,802 answers
140,978 comments
58,918 users