The tree protocol use if all applications tend to

Info iconThis preview shows pages 8–10. Sign up to view the full content.

View Full Document Right Arrow Icon
The tree protocol: Use if all applications tend to access data items in an order consistent with a particular partial order. This protocol is free of deadlocks, but transactions will often have to lock unwanted nodes in order to access the desired nodes. Timestamp ordering: Use if the application demands a concurrent execution that is equivalent to a particular serial ordering (say, the order of arrival), rather than any serial ordering. But conFicts are han- dled by roll-back of transactions rather than waiting, and schedules are not recoverable. To make them recoverable, additional overheads and increased response time have to be tolerated. Not suitable if there are long read-only transactions, since they will starve. Deadlocks are absent. Validation: If the probability that two concurrently executing trans- actions conFict is low, this protocol can be used advantageously to get better concurrency and good response times with low overheads. Not suitable under high contention, when a lot of wasted work will be done. Multiversion timestamp ordering: Use if timestamp ordering is ap- propriate but it is desirable for read requests to never wait. Shares the other disadvantages of the timestamp ordering protocol. Multiversiontwo-phaselocking:Thisprotocolallowsread-onlytrans- actions to always commit without ever waiting. Update transactions follow 2PL, thus allowing recoverable schedules with conFicts solved by waiting rather than roll-back. But the problem of deadlocks comes back, though read-only transactions cannot get involved in them. Keeping multiple versions adds space and time overheads though, therefore plain 2PL may be preferable in low conFict situations. 15.15 Answer: A transaction waits on a. disk I/O and b. lock acquisition. Transactions generally wait on disk reads and not on disk writes as disk
Background image of page 8

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Practice Exercises 9 writes are handled by the buffering mechanism in asynchronous fashion and transactions update only the in-memory copy of the disk blocks. The technique proposed essentially separates the waiting times into two phases. The Frst phase – where transaction is executed without acquiring any locks and without performing any writes to the database – accounts for almost all the waiting time on disk I/O as it reads all the data blocks it needs from disk if they are not already in memory. The second phase— the transaction re-execution with strict two-phase locking—accounts for all the waiting time on acquiring locks. The second phase may, though rarely, involve a small waiting time on disk I/O if a disk block that the transaction needs is ±ushed to memory (by buffer manager) before the second phase starts. The technique may increase concurrency as transactions spend almost no time on disk I/O with locks held and hence locks are held for shorter time. In the Frst phase the transaction reads all the data items required —and not already in memory—from disk. The locks are acquired in the second phase and the transaction does almost no disk I/O in this phase. Thus the transaction avoids spending time in disk I/O with locks held.
Background image of page 9
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page8 / 11

The tree protocol Use if all applications tend to access...

This preview shows document pages 8 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online