GATE 2016 Session 5 CS Q51

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 in the following
manner:

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
(A) guarantee serializability and deadlock-freedom
(B) guarantee neither serializability nor deadlock-freedom
(C) guarantee serializability but not deadlock-freedom
(D) guarantee deadlock-freedom but not serializability

Answer

step 1. T acquire exclusive locks to  O1,O2,O3,O4........Ok in increasing order then Circular wait not possible.
step 2. the required operation are performed
step 3. released

above steps does not perfrom Deadlock.
and all 2 PL are  serilizable.

3Comments
Shreyans Dhankhar @shreyans
12 Feb 2016 09:31 pm

It will ensure serializablity but deadlock chances will be there so option C

Soumalya Som Seal @soumalyasoms
13 Feb 2016 05:24 pm

If the locks are acquired in the order, there will be no circular wait and hence no deadlock.

So A

Mohit Lalwani @monty12
14 Feb 2016 03:52 pm

step 1. T acquire exclusive locks to  O1,O2,O3,O4........Ok in increasing order then Circular wait not possible.

step 2. the required operation are performed

step 3. released

above steps does not perfrom Deadlock

and all 2 PL are  serilizable 

 

Pages