Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock?
- -phase locking
- Time-stamp ordering
View worked solution
Answer: B
To determine which protocol ensures both conflict serializability and freedom from deadlock, let us analyze each protocol:
-
I. -Phase Locking (2PL):
- Conflict Serializability: Yes. The basic 2PL protocol guarantees that any schedule it generates is conflict serializable.
- Freedom from Deadlock: No. Under 2PL, transactions acquire locks dynamically. If Transaction holds a lock on resource and waits for resource , while Transaction holds a lock on resource and waits for resource , a deadlock occurs. Thus, 2PL does not prevent deadlocks.
-
II. Time-stamp Ordering (TO):
- Conflict Serializability: Yes. The protocol uses transaction timestamps to decide the serialization order. Any conflicting operations are executed in the order of their timestamps.
- Freedom from Deadlock: Yes. In the timestamp ordering protocol, transactions do not wait for each other by holding locks. If an operation violates the timestamp order, the transaction is immediately aborted and restarted with a new timestamp. Since there is no waiting, circular wait is impossible, ensuring absolute freedom from deadlock.
Therefore, only II (Time-stamp ordering) ensures both properties.
Correct Option: B (II only)
Free practice · Your answers on this page are not saved.
