Is in l t i i l t j contradicting the denition of f t

Info iconThis preview shows pages 5–8. Sign up to view the full content.

View Full Document Right Arrow Icon
) is in L ( T i ) i L ( T j ) contradicting the de±nition of F ( T i , T j ). b. Lemma 2 Now we show that, T i h u T j for all u L ( T i ) i L ( T j ) iff T i h F ( T i , T j ) T j . If u = F ( T i , T j ) then T i h F ( T i , T j ) T j . is trivially true. If u n= F ( T i , T j ), then u / ∈ { E ( T i ) , E ( T j ) } . It thus follows that some predecessor of w of u was successfully locked by both T i and T j and this u was
Background image of page 5

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

View Full Document Right Arrow Icon
6 Chapter 15 Concurrency Control locked by T i and T j when they issued the instructions to lock u . Thus, T i H w T j T i H u T j (and T j H w T i T j H u T i ). Now by induction: T i H F ( T i , T j ) T j T i H w T j and the result follows. Now,weprovethatthegivenprotocolensuresserializabilityanddeadlock freedom by induction on the length of minimal cycle. a. m = 2 : The protocol ensures no minimal cycles as shown in the above Lemma 2 b. m > 2 : Assume by contradiction that T 0 H T 1 H T 2 ...... H T m 1 H T 0 is a minimal cycle of length m . We will con- sider two cases: i. F ( T i , T i + 1 )’s are not all distinct. It follows that, L ( T i ) i L ( T j ) i L ( T k ) n= h for 0 i j k m 1 A. Assume < i , j , k > = < i , i + 1 , i + 2 > . Then it easily follows that T i H T i + 2 and (*) is not a minimal cycle. B. Assume < i , j , k > n= < i , i + 1 , i + 2 > . If say | j i | > 1 then as either T i H T j or T j H T i and (*) is not a minimal cycle. If | j i | = 1 and | k j | > 1 then the proof is analogous. . ii. All F ( T i , T i + 1 )’s are distinct. Then for some i ± ( F ( T i , T i + 1 )) < ± ( F ( T i + 1 , T i + 2 )) (**) and ± ( F ( T i + 1 , T i + 2 )) > ± ( F ( T i + 2 , T i + 3 )) (***) By(**), E ( T i + 1 ) n= F ( T i + 1 , T i + 2 )andby(***), E ( T i + 2 ) n= F ( T i + 1 , T i + 2 ). Thus, F ( T i + 1 , T i + 2 ) / ∈ { E ( T i + 1 ) , E ( T i + 2 ) } ,acontradictiontoLemma 1. We have thus shown that the given protocol ensures serializability and deadlock freedom. 15.8 Answer: The proof is Silberschatz and Kedem, A Family of Locking Protocols for Database Systems that Are Modeled by Directed Graphs , IEEE Trans. on Software Engg. Vol. SE-8, No. 6, Nov 1982. The proof is rather complex; we omit details, which may be found in the above paper.
Background image of page 6
Practice Exercises 7 15.9 Answer: Theaccessprotectionmechanismcanbeusedtoimplementpage level locking. Consider reads frst. A process is allowed to read a page only aFter it read-locks the page. This is implemented by using mprotect to initially turn oFF read permissions to all pages, For the process. When the process tries to access an address in a page, a protection violation occurs. The handler associated with protection violation then requests a read lock on the page, and aFter the lock is acquired, it uses mprotect to allow read access to the page by the process, and fnally allows the process to continue. Write access is handled similarly. 15.10
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page5 / 11

is in L T i i L T j contradicting the denition of F T i T j...

This preview shows document pages 5 - 8. Sign up to view the full document.

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