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

What are audit trails, What are audit trails? An audit trail is a log o...

What are audit trails? An audit trail is a log of all alters to the database along with information like which user performed the change and when the alter was performed.

Why are cursors necessary in embedded sql, Why are cursors necessary in emb...

Why are cursors necessary in embedded SQL? A cursor is an object used to store the output of a query for row-by-row processing through the application programs. SQL statements

Database part of ldb?, Is it mandatory to declare all the tables in Report ...

Is it mandatory to declare all the tables in Report by the key word tables for all the tables that exist in the structure of LDB, and are being explained in the Database part of LD

Describe entity referential integrity and integrity, Describe entity refere...

Describe entity referential integrity and integrity. Give an example of each. Entity Integrity Rule - If there is a attribute A of relation R is a prime attribute of R then A

What are data models, What are data models? Explain it detail? Entity ...

What are data models? Explain it detail? Entity relationship model Rectangles Ellipse Diamonds Lines Relational model Relational model use a collection

What is disadvantage of multiple inheritances, What is disadvantage of mult...

What is disadvantage of multiple inheritances? There is potential ambiguity if the similar variable or method can be inherited from more than one superclass.eg: student class m

Query optimization, what is meant semantic query optimization? how does it ...

what is meant semantic query optimization? how does it differ from other query optimization techniques?

What is difference between primary index and secondary index, What is diffe...

What is difference between primary index and secondary index? Primary Index a) It is an ordered file whose records are of fixed length along with two fields. b) Only base

Explain the difference between drop and delete, Explain the Difference betw...

Explain the Difference between DROP and DELETE DELETE deletes one or more than one tuples of a particular relation from the database. DROP is employed to remove a table from th

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