Ans will be c because

The Gateway to Computer Science Excellence

+19 votes

Consider two transactions $T_1$ and $T_2$, and four schedules $S_1, S_2, S_3, S_4$, of $T_1$ and $T_2$ as given below:

$T_1: R_1[x]W_1[x]W_1[y]$

$T_2: R_2[x]R_2[y]W_2[y]$

$S_1: R_1[x]R_2[x]R_2[y] W_1[x] W_1[y] W_2[y]$

$S_2: R_1[x]R_2[x]R_2[y] W_1[x] W_2[y] W_1[y]$

$S_3: R_1[x]W_1[x]R_2[x] W_1[y] R_2[y] W_2[y]$

$S_4: R_2[x]R_2[y]R_1[x] W_1[x] W_1[y] W_2[y]$

Which of the above schedules are conflict-serializable?

- $S_1 \text{ and } S_2$
- $S_2 \text{ and } S_3$
- $S_3$ only
- $S_4$ only

+24 votes

Best answer

The answer is B.

- S1 has a cycle from $T1\to T2$ and $T2 \to T1.$
- S2-- It is uni-directional and has only $T2\to T1.$
- S3-- It is uni-directional and has only $T1\to T2.$
- S4-- same as S1.

A schedule is conflict serializable if there is no cycle in the directed graph made by the schedules.

In the schedules we check for RW, WR, WW conflicts between the schedules and only these conflicts contribute in the edges of the graph.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,370 answers

198,506 comments

105,276 users