Deadlock prevantion method | OS | DBMS

Deadlock Prevention

  • Deadlock prevention method is suitable for a large database. If the resources are allocated in such a way that deadlock never occurs, then the deadlock can be prevented.
  • The Database management system analyzes the operations of the transaction whether they can create a deadlock situation or not. If they do, then the DBMS never allowed that transaction to be executed.
  • Prevantion is a method of deadlock handling which violet one of four neccesory condition of deadlock. 
Voiletion of mutual exclusion :-

  • In practicle, any resources is non sharable which means resource cannot work on more then one process at a time.
  • For voilet mutual exclusion , all resources must be sharable that means at a time more than one process can get a hold of the resources. That approach is practically impossible.
  • Resources is sharable or non sharable is depends on property of hardware.
  • Mutual exclusion method can't voilet .

Voiletion of hold and wait:-

Three approaches used for voilet hold and wait condition.

 1. Consecutive approach :-

  • Process is allowed to start execution if and only if it has acquired all the resources.  
  • Merit and demarits contains ( less efficient, not implementeble, easy ,deadlock independence) .
2. Do not hold :-
  • Process will acquire only desired resources but before making any fresh request it must release  all the resources that it currently hold.
  • It is efficient and implemented.
3. Wait timeout:-
  • We place a maximum time out which a process can wait after which process must release all the holding resources.

Voiletion of no pre-emption :-

  • Forcefully pre-emption :-  we allow a process to forcefully prempt the resources holding by                                                 other processes.
  • This method may be used by high priority process on system process.
  • The process which are in waiting state must be selected as victim instead of which are in running state.

Voiletion of circular wait :-

  • Circular wait can be eliminated by first giving a natural number of every resources.
                  f:N-->R
  • Allow every process to either increasing or decreasing order in the resource number.
  • If a process require lesser number(in case of increasing order) then it must release all the resources larger then required number.
Thank you viewers. 
This is published by soumy Sinha  .if u like the share with your frnds..

Comments

Popular posts from this blog

Introduction of Digital computer

INTRODUCTION OF DBMS

Introduction to cache memory