Which of the following concurrency control protocols ensure(s) both conflict…

2018

Which of the following concurrency control protocols ensure(s) both conflict serializability and freedom from deadlock?

I. 2-phase locking II. Timestamp ordering

  1. A.

    I only

  2. B.

    II only

  3. C.

    Both I and II

  4. D.

    Neither I nor II

Attempted by 4 students.

Show answer & explanation

Correct answer: B

Concept: A concurrency control protocol must be judged against two separate properties -- (a) conflict serializability, meaning every schedule it produces is equivalent to some serial execution of the transactions, and (b) freedom from deadlock, meaning no set of transactions can end up in a cycle where each waits for a resource held by another. A protocol earns property (a) by controlling the relative order of conflicting operations (read-write, write-read, write-write on the same item). It earns property (b) only if it never forces a transaction to block indefinitely for another transaction's lock -- a protocol that resolves conflicts by blocking (waiting) can still deadlock even while it enforces serializability; a protocol that resolves conflicts by aborting/restarting the offending transaction instead of blocking cannot deadlock, because no transaction ever waits for another.

Application:

  1. Statement I -- 2-phase locking (2PL): in its growing phase a transaction acquires all the locks it needs and in its shrinking phase it releases them; this discipline does guarantee conflict serializability. But 2PL is a blocking protocol -- if transaction T1 holds a lock that T2 needs, T2 simply waits. Two transactions can each hold a lock the other is waiting for, forming a wait-for cycle, i.e. a deadlock. So plain 2-phase locking gives serializability but does not by itself give freedom from deadlock.

  2. Statement II -- timestamp ordering: every transaction is assigned a unique timestamp when it starts, and every conflicting pair of operations is forced into timestamp order. When an operation arrives that would violate this order, the protocol aborts and restarts the transaction that is out of order rather than making it wait. Because no transaction is ever kept waiting on another, no wait-for cycle can ever form -- so timestamp ordering gives both conflict serializability (the schedule is equivalent to the timestamp order) and freedom from deadlock.

Protocol

Conflict serializable?

Deadlock-free?

2-phase locking (I)

Yes -- growing/shrinking lock phases enforce it

No -- blocking waits can form a wait-for cycle

Timestamp ordering (II)

Yes -- schedule is equivalent to timestamp order

Yes -- conflicts resolved by abort/restart, never by waiting

Cross-check: within lock-based schemes, deadlock-freedom is not automatic -- it needs an extra discipline layered on top, such as conservative 2-phase locking (acquiring every lock before execution begins) or a prevention scheme like wait-die/wound-wait. Statement I refers to plain 2-phase locking, which carries none of these extra disciplines, so it still lacks the deadlock-freedom guarantee -- confirmed independently for each protocol by the table above.

Only the timestamp-ordering protocol carries both properties, so the correct choice is the one that selects statement II alone.

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…