An exclusive lock being incompatible with itself adds

Info icon This preview shows pages 7–9. Sign up to view the full content.

View Full Document Right Arrow Icon
An exclusive lock being incompatible with itself adds to the lock waiting time and obstructs the overall progress of the concurrent schedule. In general, increasing the true entries in the compatibility matrix increases the concurrency and improves the throughput. The proof is in Korth, Locking Primitives in a Database System, JACM Vol. 30, 1983. 15.11 Answer: It would make no difference. The write protocol is such that the most recent transaction to write an item is also the one with the largest timestamp to have done so. 15.12 Answer: If a transaction needs to access a large a set of items, multiple granularity locking requires fewer locks, whereas if only one item needs to be accessed, the single lock granularity system allows this with just one lock. Because all the desired data items are locked and unlocked together in the multiple granularity scheme, the locking overhead is low, but concurrency is also reduced. 15.13 Answer: In the concurrency control scheme of Section 15.5 choosing Start ( T i ) as the timestamp of T i gives a subset of the schedules allowed by choosing Validation ( T i ) as the timestamp. Using Start ( T i ) means that whoever started first must finish first. Clearly transactions could enter the validation phase in the same order in which they began executing,
Image of page 7

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

View Full Document Right Arrow Icon
8 Chapter 15 Concurrency Control but this is overly restrictive. Since choosing Validation ( T i ) causes fewer nonconflicting transactions to restart, it gives the better response times. 15.14 Answer: Two-phase locking: Use for simple applications where a single granu- larity is acceptable. If there are large read-only transactions, multiver- sion protocols would do better. Also, if deadlocks must be avoided at all costs, the tree protocol would be preferable. Two-phase locking with multiple granularity locking: Use for an ap- plication mix where some applications access individual records and others access whole relations or substantial parts thereof. The draw- backs of 2PL mentioned above also apply to this one. 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 conflicts 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 conflict is low, this protocol can be used advantageously to get better concurrency and good response times with low overheads.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern