• edited by
33,575 views
72 72 votes

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

  1. $2$-phase locking
  2. Time-stamp ordering
    1. I only
    2. II only
    3. Both I and II
    4. Neither I nor II

8 Answers

Best answer
77 77 votes
In basic two phase locking there is a chance for deadlock

Conservative $\text{2pl}$ is deadlock free

I go with B.
• edited by
23 23 votes
Answer is B.

2PL ensures conflict serializability but is not deadlock free.

Timestamp ordering ensures conflict serializability because if any action causes violation in serializability order that was being followed from beginning of schedule, then the transaction is rolled back and again started with new timestamp.

It also ensures freedom from deadlock because there are no locks.. which means no mutual exclusion.
6 6 votes

Two phase locking ensures conflict serializable schedules, but does not ensure freedom from deadlock.

One the other hand, Timestamp ordering protocol ensures freedom from deadlock but does not ensure conflict serializable schedules.

ensure = every schedule is conflict serializable. Hence the answer is D

Reference: http://codex.cs.yale.edu/avi/db-book/db4/slide-dir/ch16-2.pdf

Additional info: Tree based protocol ensures both, freedom from deadlocks and conflict serializable schedule.

4 4 votes

2 Phase Locking (2PL) is a concurrency control method that guarantees serializability. The protocol utilizes locks, applied by a transaction to data, which may block (interpreted as signals to stop) other transactions from accessing the same data during the transaction’s life. 2PL may be lead to deadlocks that result from the mutual blocking of two or more transactions. See the following situation, neither T3 nor T4 can make progress.

Timestamp-based concurrency control algorithm is a non-lock concurrency control method. In Timestamp based method, deadlock cannot occur as no transaction ever waits.

2 2 votes

BEST ANSWER

2PL ensures conflict serializability but there is a chance for deadlock

Timestamp Based Ordering Protocol is :

  • Conflict serializable i.e. it is conflict equivalent to some serial schedule.
  • It is deadlock free because timestamp ordering protocol allows rollback and restart it after detecting a mismatched situation.
 
Answer:
Position:
Show:

Related questions

48 48 votes
5 answers 5 answers
16.7k
16.7k views
go_editor asked Sep 30, 2014
16,700 views
Consider the following schedule for transactions $T1, T2$ and $T3:$$$\begin{array}{|c|c|c|}\hline \textbf{T1} & \textbf{T2} & \textbf{T3} \\\hline \text{Read(X)} & \text...
74 74 votes
11 answers 11 answers
26.5k
26.5k views
go_editor asked Sep 30, 2014
26,514 views
The following functional dependencies hold for relations $R(A, B, C)$ and $S(B, D, E).$ $ B \to A$$A \to C$The relation $R$ contains $200$ tuples and the relation $S$ con...
48 48 votes
2 answers 2 answers
13.2k
13.2k views
go_editor asked Sep 29, 2014
13,154 views
A relational schema for a train reservation database is given below.passenger(pid, pname, age)reservation(pid, class, tid)$$\overset{\text{Passenger}}{\begin{array}{|c|c|...
97 97 votes
10 answers 10 answers
41.1k
41.1k views
go_editor asked Apr 21, 2016
41,094 views
A computer system has an $L1$ cache, an $L2$ cache, and a main memory unit connected as shown below. The block size in $L1$ cache is $4$ words. The block size in $L2$ cac...