Ask a question from expert

Ask now

Deadlock: Definition, Prevention and Avoidance Strategies

3 Pages771 Words493 Views
   

Added on  2019-09-20

About This Document

Deadlock is a situation that arises in a shared resource environment, where a process waits for a resource for indefinite time because that resource is already occupied by another process. This article discusses the definition of deadlock and several strategies to deal with it, including deadlock prevention and avoidance. Wait-Die and Wound-Wait schemes are explained in detail, along with the Wait-for Graph approach.

Deadlock: Definition, Prevention and Avoidance Strategies

   Added on 2019-09-20

BookmarkShareRelated Documents
Q) What is a deadlock, and how can it be avoided? Discuss several strategies for dealing with deadlocks.Ans:Deadlock:Deadlock situation occur when there is a multiple processes are processed simultaneously by system. Deadlock is a situation that arises in a shared resource environment, where a process waits for a resource for indefinite time because that resource is already occupied by another process. This situation comes under deadlock. For example: There are n number of transactions like t1, t2...tn. T1 requires a resource that is x to complete its process or a task. But Resource x isheld by T2, and T2 is waiting for a resource y, which is held by T3. T3 is waiting for resource z, which is occupied by T1. So, all the transactions are waiting for each other to release resources to complete their processes. So being in this situation no transaction can complete their task or process. This point of situation is called deadlock.Strategies to deal with deadlock: 1. Deadlock Prevention: to prevent deadlock situation in the system, the DBMS inspects all theoperations and determine whether transactions can create a deadlock situation. If there is any possibility for deadlock situation, then tat transaction is never allowed to be executed. Here are some scheme explained to prevent deadlock which uses timestamp ordering mechanism for transactions in order to predetermine a deadlock situation.A)Wait-Die: according to this scheme, this allows the transaction requests to lock a resource which is already held with a conflicting lock by another transition. Here are two possibilitiesIf TS(Tx) < TS(Ty) − that is Tx, which is requesting a conflicting lock, is older than Ty− thenTxis allowed to wait until the resource is available.If TS(Tx) > TS(ty) − that is Txis younger than Ty− then Txdies. Txis restarted later with a random delay but with the same timestamp.This method permits the older transaction to wait for resource and to complete its process but kills newer one.
Deadlock: Definition, Prevention and Avoidance Strategies_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Science Lab Report Assignment | Questions and Answers
|3
|719
|625