Skip to content

Commit ae1afd3

Browse files
committed
Finish Chapter 18 section 3
1 parent 8709cf1 commit ae1afd3

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

src/chapter_18/ch18.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ \section{Chapter 18 Concurrency Control}
66

77
\subfile{./sec1.tex}
88
\subfile{./sec2.tex}
9+
\subfile{./sec3.tex}
910

1011
\end{document}

src/chapter_18/sec3.tex

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
\documentclass[../../main.tex]{subfiles}
2+
3+
\begin{document}
4+
5+
\subsection{18.3 Enforcing Serializability by Locks}
6+
7+
\subsubsection*{Exercise 3.1}
8+
9+
a)
10+
11+
Suppose that we have the schedule derived from the given transactions.
12+
13+
$$
14+
r_{1}(A); r_{2}(B); w_{2}(B); r_{2}(A); w_{1}(A); r_{1}(B); w_{1}(B); w_{2}(A)
15+
$$
16+
17+
Note that $r_{1}(A)$ must hold a lock on $A$, since a transaction is granted with
18+
lock before its read and write action. Likewise, $r_{2}(A)$ must also hold a lock
19+
on $A$.
20+
21+
Since the unlock of $A$ for $r_{1}(A)$ is executed after $w_{1}(A)$ and $r_{2}(A)$
22+
appears before $w_{1}(A)$. Therefore, the schedule is prohibited.
23+
24+
b)
25+
26+
$$
27+
\frac{4!}{2! \times (4 - 2)!} \times \frac{4!}{2! \times (4 - 2)!} + 2 = 38
28+
$$
29+
30+
c)
31+
32+
$$
33+
\frac{4!}{2! \times (4 - 2)!} \times \frac{4!}{2! \times (4 - 2)!} = 36
34+
$$
35+
36+
37+
d)
38+
39+
The number of conflict serializable schedule is 2.
40+
41+
e)
42+
43+
All legal schedules are serializable. It is impossible for a legal schedule
44+
to be unserializable.
45+
46+
\subsubsection*{Exercise 3.2}
47+
48+
Need community help.
49+
50+
\subsubsection*{Exercise 3.3}
51+
52+
Need community help.
53+
54+
\subsubsection*{Exercise 3.4}
55+
56+
Need community help.
57+
58+
\end{document}

0 commit comments

Comments
 (0)