• retagged by
18,907 views
26 26 votes

Let $\textit{R}_{i}(z)$ and $\textit{W}_{i}(z)$ denote read and write operations on a data element $z$ by a transaction $\textit{T}_{i},$ respectively. Consider the schedule $\textit{S}$ with four transactions.

$S: \; R_{4}(x) R_{2}(x) R_{3}(x)R_{1}(y) W_{1}(y) W_{2}(x) W_{3}(y) R_{4}(y)$

Which one of the following serial schedules is conflict equivalent to $\textit{S}?$

  1. $T_{1} \rightarrow T_{3} \rightarrow T_{4} \rightarrow T_{2}$
  2. $T_{1} \rightarrow T_{4} \rightarrow T_{3} \rightarrow T_{2}$
  3. $T_{4} \rightarrow T_{1} \rightarrow T_{3} \rightarrow T_{2}$
  4. $T_{3} \rightarrow T_{1} \rightarrow T_{4} \rightarrow T_{2}$

3 Answers

Best answer
25 25 votes

Answer : Option A


Conflict operations:

  1. Transaction $T_i$ reading data item K, after that Transaction $T_j$ writing data item K
  2. Transaction $T_i$ writing data item K, after that Transaction $T_j$ reading data item K
  3. Transaction $T_i$ writing data item K, after that Transaction $T_j$ writing data item K.

Note that, Transaction $T_i$ writing data item ‘K’, after that Transaction $T_j$ writing data item ‘P’ are not conflict operations due to those are different data items.

Tabular representation of given schedule is :

If you observe,

  1. Line 1 and Line 6 are conflict operations. So in Serial schedule Transaction $T_4$ must be before  $T_2$
  2. Line 3 and Line 6 are conflict operations. So in Serial schedule Transaction $T_3$ must be before  $T_2$
  3. Line 4 and Line 7 are conflict operations. So in Serial schedule Transaction $T_1$ must be before  $T_3$
  4. Line 5 and Line 8 are conflict operations. So in Serial schedule Transaction $T_1$ must be before  $T_4$
  5. Line 7 and Line 8 are conflict operations. So in Serial schedule Transaction $T_3$ must be before  $T_4$

Accumulating all these points and running Topological sort, $T_1$ should be first followed by $T_3,T_4$ and $T_2$ in order.

• selected by
30 30 votes

Precedence graph from the schedule :

Answer:
Position:
Show:

Related questions

44 44 votes
3 answers 3 answers
13.6k
13.6k views
go_editor asked Sep 28, 2014
13,576 views
Consider the transactions $T1, T2, \:\text{and} \:T3$ and the schedules $S1 \:\text{and} \:S2$ given below. $T1: r1(X); r1(Z); w1(X); w1(Z) $$T2: r2(Y); r2(Z); w2(Z) $$T3...
89 89 votes
4 answers 4 answers
46.2k
46.2k views
go_editor asked Sep 28, 2014
46,232 views
Consider the following schedule S of transactions $T1, T2, T3, T4:$$${\begin{array}{|l|l|l|l|}\hline\textbf{T1}& \textbf{T2}& \textbf{T3}& \textbf{T4} \\\hline& \...
39 39 votes
4 answers 4 answers
15.1k
15.1k views
go_editor asked Sep 26, 2014
15,135 views
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by $r(x)$ and $w(x)$ respectiv...
33 33 votes
3 answers 3 answers
17.4k
17.4k views
Arjun asked Feb 18, 2021
17,412 views
​​​​​Let $S$ be the following schedule of operations of three transactions $T_1$, $T_2$ and $T_3$ in a relational database system:$$R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), ...