StreakPeaked· Practice

ExamsGATETechnical

Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,...,Ok}. This is done in the following manner: Step 1. T acquires exclusive locks to O1,...,Ok in increasing order of their addresses. Step 2. The required operations are performed. Step 3. All locks are released. This protocol will

  1. guarantee serializability and deadlock-freedom
  2. guarantee neither serializability nor deadlock-freedom
  3. guarantee serializability but not deadlock-freedom
  4. guarantee deadlock-freedom but not serializability

Correct answer: guarantee serializability and deadlock-freedom

Solution

The protocol ensures that locks are acquired in a strict order, which prevents circular wait conditions, thereby achieving deadlock-freedom. Additionally, by acquiring all necessary locks before performing any operations, it guarantees that the transactions will execute in a manner that is equivalent to some serial execution, ensuring serializability.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →