Showing posts with label Deadlock. Show all posts
Showing posts with label Deadlock. Show all posts

Wednesday, January 13, 2016

Wait-die deadlock prevention algorithm in Animation

Animated Wait-die deadlock prevention algorithm / Wait-Die scheme explained / How does wait-die scheme prevents deadlock / Wait-die algorithm example in DBMS


Wait-Die Deadlock Prevention Algorithm







For more examples, please visit:

Deadlock prevention algorithms in database


Wednesday, October 15, 2014

4 necessary conditions for occurrence of deadlock


Four necessary conditions for occurrence of deadlock in databases / Four necessary conditions for deadlock to occur / Necessary and sufficient conditions for deadlock / List and discuss four conditions for deadlock / Necessary conditions that ensures a deadlock occurrence state

 

Necessary conditions for deadlock to occur in database


A deadlock can arise if the following 4 conditions hold simultaneously in a system;

  • Mutual exclusion: At least one resource is held in a non-sharable mode. For example, among transactions if there is any Exclusive lock (Write lock) request, that data item cannot be shared with others.
  • Hold and wait: There is a transaction which acquired and held lock on a data item, and waits for other data item.
  • No preemption: A situation where a transaction releases the locks on data items which it holds only after the successful completion of the transaction. Not on voluntarily.
  • Circular wait: A situation where a transaction say T1 is waiting for another transaction T2 to release lock on some data items, in turn T2 is waiting for another transaction T3 to release lock, and so on.
During transaction processing, if all the said conditions are held then there occurred a deadlock.