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. SE8, No. 6, Nov 1982.
The proof is rather complex; we omit details, which may be found in the
above paper.