Question
Let and denote read and write operations respectively on a data item by a transaction . Consider the following two schedules.
Which one of the following options is correct?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2021 answer key
Solution
Construct the precedence (conflict) graph for each schedule and check for directed cycles.
Two operations conflict if they belong to different transactions, access the same data item, and at least one of them is a write.
Examine schedule :
- Operation precedes on item .
- Operation precedes on item .
The precedence graph contains a cycle . Hence, is not conflict serializable.
Examine schedule :
- Operation precedes on item .
- Operations and precede on item .
There are no conflicts where an operation of precedes an operation of . The precedence graph contains only the edge , which is acyclic. Hence, is conflict serializable (equivalent to serial schedule ).
Thus, is not conflict serializable, and is conflict serializable (option B).
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology (CS, Set-1)
- Question
- 42 of 65, printed as CS Q.32
- 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.