Which concurrency control protocol prevents deadlock and ensures…
2025
Which concurrency control protocol prevents deadlock and ensures serializability?
- A.
2PL
- B.
Optimistic locking protocol
- C.
Timestamp ordering protocol
- D.
Strict 2PL
- E.
Shared locking protocol
Attempted by 48 students.
Show answer & explanation
Correct answer: C
Concept
A concurrency control protocol is judged on two independent properties: whether it guarantees serializability (the concurrent schedule is equivalent to some serial order) and whether it can deadlock (transactions blocked in a cyclic wait). A protocol that NEVER makes a transaction wait for a lock cannot form a wait-cycle, so it is deadlock-free by construction.
Application
Under timestamp-ordering, every transaction is assigned a unique timestamp on arrival, and each data item carries read- and write-timestamps. Conflicting operations are forced into timestamp order:
A transaction whose operation would violate the timestamp order is aborted and restarted with a new timestamp — it is never blocked waiting.
Because no transaction ever waits on another, no wait-for cycle can form, so deadlock is impossible.
Serializing every conflicting pair by timestamp yields a schedule equivalent to the serial order of the timestamps, so the schedule is conflict-serializable.
Both required properties — serializability and freedom from deadlock — hold together only for timestamp-ordering among the choices.
Contrast
2PL guarantees conflict-serializability but uses blocking locks, so two transactions can wait on each other and deadlock. Strict 2PL adds cascadeless recovery on top of 2PL but is still a locking protocol and is equally deadlock-prone. “Optimistic” validation defers conflict checks to a validation phase and resolves conflicts by aborting, but it is not the classical waiting-free protocol named for this guarantee, and shared-locking alone is only one lock mode, not a complete protocol that ensures serializability.
Result
Timestamp ordering protocol is the protocol that both prevents deadlock and ensures serializability.