hw6 - Sheet1 Page 1 Homework #6 CS 308 - CS 6083 Spring...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sheet1 Page 1 Homework #6 CS 308 - CS 6083 Spring 2011 Prof Frankl If you'd like feedback before the exam, hand this in via MyPoly. Due 9:30 a.m. Tues May 3. I will go over the solutions in class that day. 1. Consider the following transactions: T1: read(A) read(B) if (A==0) then B=B+1 write(B) T2: read(B) read(A) if (B==0) then A=A+1 write(A) a) if A and B are both initially zero, what final values of A and B are possible in serial schedules? What final values are possib : For serial schedules, we can have either T1 then T2, or vice versa 1. T1 followed by T2 (0,1) 2. T2 followed by T1 (1,0) 3. All reads, then alternating checks, then wrigin (1,1)--- b) Add lock and unlock instructions so that the transactions obey the two-phase locking protocol. Conflict serializable equivalent to serial evaluate - (0,1) or (1,0) T1 Lock-S(A) read(A) Lock-X(B) <- must be during growing phase unlock(A) read(B) if(A==0) write(B) unlock(B) c) What final values of (A,B) are possible with schedules arising from the transactions with two-phase locking?c) What final values of (A,B) are possible with schedules arising from the transactions with two-phase locking?...
View Full Document

Page1 / 3

hw6 - Sheet1 Page 1 Homework #6 CS 308 - CS 6083 Spring...

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