1 Answers

Option 4 : Any one of I, II, III and IV

Concept:

A deadlock will not occur if one of the following four conditions doesn’t occur :

  • Mutual exclusion: it prevents simultaneous access to a shared resource.
  • Hold and wait: Process is holding a resource that may be required by other processes.
  • Circular wait: It means there are processes which are waiting for other processes to finish.
  • No pre-emption: If a process that is holding some resources requests another resource and that  resource cannot be allocated to it, then it must release all resources that are currently allocated to it.


Explanation:

Option 1:

Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released. If this is allowed , then hold and wait will never occur. So, deadlock will not occur.

Option 2:

The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource numbers. It violates circular wait .

Option 3:

The resources are numbered uniquely, and processes are allowed to request for resources only in decreasing resource numbers. It also violates circular wait.

Option 4:

The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resources. It also violates circular wait.

So, all options are needed to prevent deadlock. 
5 views

Related Questions