Question
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) respectively. Which one of them is conflict serializable?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2014 answer key
Solution
Construct the precedence (serialization) graph for each schedule and check for acyclicity.
A schedule is conflict serializable if and only if its precedence graph is directed and acyclic.
Two operations on the same data item conflict if at least one of them is a write and they belong to different transactions:
-
Schedule (A):
Cycle: . Not conflict serializable.
-
Schedule (B):
Cycle: . Not conflict serializable.
-
Schedule (C):
Cycle: . Not conflict serializable.
-
Schedule (D):
Edges in graph: and (and ).
There are no cycles! A valid topological ordering is .
Thus, schedule D is conflict serializable.
D
Overlooking write-read or read-write conflicts between early and late transactions.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 1
- Question
- 39 of 65, printed as CS Q.29
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.