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

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

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

View Full Document
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

## This note was uploaded on 09/10/2011 for the course CS 308 taught by Professor Frankl during the Spring '11 term at NYU Poly.

### Page1 / 3

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

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

View Full Document
Ask a homework question - tutors are online