What are wait-for-graphs, Database Management System

Assignment Help:

What are wait-for-graphs?Give the algorithm to construct a wait-for-graph from a given schedule of transactions? How can deadlocks be detected from wait-for-graphs? 

 Ans:  The wait-for-graph is a directed graph and consists of nodes and directed arcs; the nodes of the graph are active transactions. An arc of the graph is inserted among two nodes if there is a data-item is needed by the node at the tail of the arc that is being held by the node at the head of the arc. 

  Algorithm to construct wait-for-graph is as follows:

1.  For every transaction Ti active at the time of deadlock detection, make a node labeled Ti in the wait-for-graph.

2.  For every case, if there is a transaction Ti, waiting for a data-item that is at present allocated and held by transaction Tj, then there is a directed arc from the node for transaction Ti, to the node for transaction Tj.

3.  For every case, if there is a directed arc from the node for transaction Ti, to the node for transaction Tj and transaction Tj released the lock, after that remove the arc between them.

4.  There no deadlock if the wait-for-graph is acyclic.  

The wait-for-graph is employed for detection of deadlock in the system. If there is any cycle exits in the wait-for-graph, all the active transaction (denoted as nodes) are in deadlock that are in the cycle.


Related Discussions:- What are wait-for-graphs

To eliminate duplicate rows-data manipulation language, To eliminate duplic...

To eliminate duplicate rows (distinct operator)  Example: SELECT DISTINCT DEPTNO FROM EMP;

Explain the timestamp ordering protocol, Timestamp Ordering Protocol A ...

Timestamp Ordering Protocol A timestamp is a tag that can be attached to any transaction or any data item, which indicates a specific time on which the transaction or data item

Database, Three way to handle missing field val

Three way to handle missing field val

Trigger , Flights(FlightNo, DeptDateTime, Origin, ArrivalDateTime, Destinat...

Flights(FlightNo, DeptDateTime, Origin, ArrivalDateTime, Destination, Capacity, SoldSeats) Tickets(FlightNo, Seat, CustID) Where - flightNo is the PK of the flights table - DeptDa

Define deadlock prevention, Define Deadlock prevention These protocols...

Define Deadlock prevention These protocols make sure that the system will never enter a deadlock state. There are two methods to deadlock prevention. One approach makes sure t

#title., WHY SHOULD NULL IN A RELATION BE AVOID AS possible?

WHY SHOULD NULL IN A RELATION BE AVOID AS possible?

How nulls are treated in comparison operator, How nulls are treated in comp...

How nulls are treated in comparison operator? Along with comparison (relational) operators, the null values are ignored as we cannot derive the relation along with the given op

Select statement-data manipulation language, SELECT Statement This stat...

SELECT Statement This statement is used for retrieving information from the databases. It can be coupled with many clauses. Let us talk about these clauses in more detail:

What is an operand, What is an Operand? The data on which the operation...

What is an Operand? The data on which the operation is to be performed is known as an Operand

Need for multiple access paths, Need for Multiple Access Paths In pract...

Need for Multiple Access Paths In practice, most of the online information systems need the support of multi-key files. For example, consider a banking database application hav

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd