{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework 7 - (a Draw precedence graph for the schedule(b Is...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC4402 Homework#7 Due Monday November 23, 2009 1. Consider the following precedence graph for a non-serial schedule S consisting of transactions T0, T1, T2, T3 and T4: T0 T1 T3 T2 T4 (a) Is the corresponding schedule S conflict serializable? Why? (b) If you answered "yes" ( S is conflict serializable) to part (a), then give serial schedule S (for the transactions T0, T1, T2, T3 and T4) such that the serial schedule S is compatible with the par- tial order specified by the above precedence graph. 2. Consider the following two transactions: T0: read (A); read (B); if A=0 then B := B + 1; write (B). T1: read (B); read (A); if B=0 then A := A + 1; write (A). Let the consistency requirement be (A=0 OR B=0), with A=B=0 as the initial values. (a) Show that every serial schedule consisting of T0 and T1 preserves the consistency of the database. (b) Show a concurrent (non-serial) schedule S for T0 and T1 which is NOT conflict serializ- able. Draw the precedence graph for your schedule S.
Image of page 1

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

View Full Document Right Arrow Icon
-2- 3. Following is a schedule for three transactions T1, T2
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) Draw precedence graph for the schedule. (b) Is this schedule conflict serializable? Why? T1 T2 T3 read(C) write(C) read(C) write(C) read(B) read(C) write(C) read(B) write(B) write(A) write(B) write(A) 4. Given the following transactions T1, T2, and T3. T1 T2 T3 Read(A) Read(C) Read(B) Read(B) Read(A) Write(B) Write(A) Write(A) Read(C) Write(B) Write(C) Write(C) Read(D) Write(B) Write(D) (a). Add locking and unlocking statements to T1, T2 and T3, according to the two-phase locking protocol, and show the resulting transactions (with locking/unlocking state-ments) T1 ′ , T2 ′ and T3 ′ . (b). Show a concurrent (non-serial) schedule S for T1 ′ , T2 ′ , and T3 ′ such that S is dead-lock free. Draw the Wait-for graphs for S. (c). Show a partial concurrent (non-serial) schedule S ′ for T1 ′ , T2 ′ , and T3 ′ such that S ′ is dead-locked. Draw the wait-for graphs for S ′ ....
View Full 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