1 / 7

1. Review questions (20)

ACS-4902 Assignment 3 due: March 19, 2014. 1. Review questions (20) (a) What is the two-phase locking protocol? How does it guarantee serializability? (b) Describe the wait-die and wound-wait protocols for deadlock prevention.

nhung
Télécharger la présentation

1. Review questions (20)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ACS-4902 Assignment 3 due: March 19, 2014 1. Review questions (20) (a) What is the two-phase locking protocol? How does it guarantee serializability? (b) Describe the wait-die and wound-wait protocols for deadlock prevention. (c) Describe the cautious waiting, no waiting, and timeout protocols for deadlock prevention. (d) What is a timestamp? How does the system generate timestamp?

  2. ACS-4902 Assignment 3 due: March 19, 2013 • Modify the data structure for multiple-mode locks (shared and exclusive) and the algorithm for read_lock(X), write_lock(X), and unlock(X) so that upgrading and downgrading of locks are possible. (The lock and unlock operations can be found on the course page under “figures for Chapter 20”; Hint: The lock needs to check the transaction id(s) that hold the lock, if any.) (20)

  3. read_lock (X): B: if LOCK (X)="unlocked" then begin LOCK (X) "read-locked"; no_of_reads(X) 1 end else if LOCK(X)="read-locked" then no_of_reads(X)  no_of _reads(X) + 1 else begin wait (until LOCK (X)="unlocked" and the lock manager wakes up the transaction); go to B end; write_lock (X): B: if LOCK (X)="unlocked" then LOCK (X)  "write-locked" else begin wait (until LOCK(X)="unlocked" and he lock manager wakes up the transaction); go to B end; unlock_item (X): if LOCK (X)="write-locked" then begin LOCK (X) "unlocked;“ wakeup one of the waiting transactions, if any end else if LOCK(X)="read-locked" then begin no_of_reads(X)  no_of_reads(X) – 1; if no_of_reads(X)=0 then begin LOCK (X)="unlocked"; wakeup one of the waiting transactions, if any end end;

  4. ACS-4902 Assignment 3 due: March 19, 2013 3. Apply the timestamp ordering algorithm to the schedules of Figure 19.8(b) and (c), and determine whether the algorithm will allow the execution of the schedules. (the figures can be found on the course page under “figures for chapter 19”.) (20)

  5. ACS-4902 Assignment 3 due: March 19, 2013 4. The compatibility matrix of Figure 20.8 shows that IS and IX locks are compatible. Explain why this is valid. (the figures can be found on the course page under “figures for chapter 20”.) (20) 5. What is ‘certify’ lock? Explain why this kind of locks is needed for multiversion 2PL. (20)

  6. IS IX S SIX X IS yes yes yes yes no IX yes yes no no no S yes no yes no no SIX yes no no no no X no no no no no

More Related