Project ForgeSign up free
Database Management Systems
SQL & Transactions
GATE 2016
Hard

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 as follows:

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

  • guarantee serializability and deadlock-freedom
  • Bguarantee neither serializability nor deadlock-freedom
  • Cguarantee serializability but not deadlock-freedom
  • Dguarantee deadlock-freedom but not serializability

Explanation

This is a valid two-phase locking schedule (all locks acquired before any released — growing phase then shrinking phase), which guarantees conflict-serializability by the standard 2PL theorem. It ALSO guarantees deadlock-freedom: since every transaction acquires locks in the same fixed (increasing-address) global order, circular-wait — the necessary condition for deadlock — can never arise (a transaction can only ever be blocked waiting for a higher-addressed object held by another transaction that is itself progressing toward, not away from, releasing its locks in that same consistent order).

Source: GATE CS 2016 (Session 1 / Set A) (2016)

This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.

Start revising free