preview

Nt1330 Unit 5 Assignment 1

Decent Essays

For your written assignment: When a detection algorithm determines that a deadlock exists, the system must recover from the deadlock. The most common solution is to roll back one or more transactions to break the deadlock. List the three actions that need to be taken using figure 16.18 to discuss.
Basically deadlock happens when we are using a management system of transactions based on locks and we have two transactions (T1 and T2) that are dependent from the same data from the database, the transaction T1 lock the data item A to start the process, and transaction T2 waits until the transaction T1 to unlock the data A, and then it be able to read(A) or write(A).
The figure 16.18 show a cycle of transactions, from transactions 25 to 28, it is …show more content…

In the graph G, there are some dependency where T25 needs to wait for data release of T27 and T26, T27 needs to wait for T26, and T26 is waiting for T28, the figure 16.18 then show the graph wait-for-graph. Considering the content of the book, the deadlock occurs when there is a cycle in the graph, in the case of the figure it doesn't exists, not in deadlock state.
In the figure 16.19 a deadlock occurs due having a cycle in the graph:
Assignment 2
3
When the algorithm detects a deadlock in the graph (figure 16.19), is necessary to recover from it, as said in the solution of the question, the roll back is the simplest solution, but for it the three actions are required:
1 – Selection of a victim: the selection of victim is basically locate which transaction or transactions will be rolled back to solve the deadlock, to determine which one, one strat that is taken is the minimum cost, the transaction with minimum cost will be rolled back, for it is necessary to; determine the how long the transaction is active, quantity of data used, quantity of data items necessary to terminate the transaction and how many transactions will be involved in the roll back.
2 – Rollback: when the victim is found, is necessary to determine which type of

Get Access