Homework 7

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

Info iconThis 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 twotransactions: 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 consistencyrequirement be (A=0 OR B=0), with A=B=0 as the initial values. (a) Showthat every serial schedule consisting of T0 and T1 preserves the consistencyofthe database. (b) Showaconcurrent (non-serial) schedule S for T0 and T1 which is NOTconflict serializ- able. Drawthe precedence graph for your schedule S.
Background image of page 1

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

View Full DocumentRight Arrow Icon
-2- 3. Following is a schedule for three transactions T1, T2 and T3.
Background 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

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

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