• edited by
37,643 views
107 107 votes

Consider the following transactions with data items $P$ and $Q$ initialized to zero:
$${\begin{array}{|c|l|r|c|}\hline
   \textbf{$T_1$}&    \text{read (P);}\\ & \text{read (Q);} \\ & \text{if P = 0 then Q := Q + 1; }\\ &      \text{write (Q)}  \\ \hline   
\textbf{$T_2$}& \text{read (Q);}\\& \text{read (P);} \\ & \text{if Q = 0 then P := P + 1;}   \\ & \text{write (P)} \\     \hline
\end{array}}$$

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

  1. a serializable schedule
  2. a schedule that is not conflict serializable
  3. a conflict serializable schedule
  4. a schedule for which a precedence graph cannot be drawn

10 Answers

0 0 votes
option B
0 0 votes
read(p) in T1 will always be executed before write(p) in T2

I.e, T->T2

And

read(Q) in T2 will always be executed before Write(Q) in T1

I.e, T2->T1

So,if we take any interleaving execution these two conflict pairs will always form a cycle if we draw a precedence graph hence ,it is not conflict serializable the only way to avoid this cycle is they must be executed serially but in question it is asked about any non serial interleaving so, option B is correct
0 0 votes
Serial schedules allow only 1 r-w problem on either P or Q at a time , any non serial inter leaving creates 2  r-w problems on p or q . Hence not css . No blind write so vs==css
0 0 votes

As here No blind writes.Conflict Serializability = View Serializability.

But computations are there Therefore both are not equivalent to general serializability..

Initially P=Q=0

For Serial schedule T1->T2 Result is Q=1,P=0

For Serial Schedule T2->T1 Result is Q=0,P=1

For any concurrent Execution Result is P=1,Q=1.So No non serial execution is serializable.

Hence as it is not Serializable(General), it is not Conflic Serializable also. Since CS⊂VS⊂General Serializability

Option B

Answer:
Position:
Show:

Related questions

70 70 votes
5 answers 5 answers
23.7k
23.7k views
go_editor asked Apr 21, 2016
23,660 views
Consider the following relations $A, B$ and $C:$ $$\overset{\textbf{A}}{\begin{array}{|c|c|c|}\hline\\\textbf{Id}& \textbf{Name}& \textbf{Age} \\\hline12& \text{A...
108 108 votes
9 answers 9 answers
46.4k
46.4k views
gatecse asked Sep 29, 2014
46,371 views
Consider the following relations $A, B$ and $C:$$$\overset{\text{A}}{\begin{array}{|c|c|c|} \hline \text {ID} & \text {Name} & \text {Age} \\\hline\text{12}& \text{Arun}...
66 66 votes
4 answers 4 answers
20.7k
20.7k views
Arjun asked Sep 29, 2014
20,690 views
Suppose $R_{1} (\underline{A}, B)$ and $R_{2} (\underline{C}, D) $ are two relation schemas. Let $r_{1}$ and $r_{2}$ be the corresponding relation instances. $B$ is a for...
50 50 votes
7 answers 7 answers
26.6k
26.6k views
gatecse asked Aug 5, 2014
26,566 views
Given the basic ER and relational models, which of the following is INCORRECT?An attribute of an entity can have more than one valueAn attribute of an entity can be compo...