GATE 2016 CS – Question 61
Consider the following two phase locking protocol. Suppose a transaction $T$ accesses (for read or write operations), a certain set of objects $\{O_1, \ldots, O_k\}$. This is done in the following manner:
Step 1. $T$ acquires exclusive locks to $O_1, \ldots, O_k$ in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) guarantee serializability and deadlock-freedom
Explanation
Taking all locks before any are released and releasing them at the end is two phase locking, which guarantees serializability. Because every transaction asks for its locks in the same global order of addresses, no cycle of waiting transactions can form, so deadlock cannot happen.