Question: Consider the following two transactions: T _ ( 3 4 ) :read ( A ) ; read ( B ) ; if A = 0

Consider the following two transactions:
T_(34):read(A);
read(B);
if A=0 then B:=B+1;
write (B).
T_(35):read(B);
read(A);
if B=0 then A:=A+1;
write (A).
Add lock and unlock instructions to transactions T_(34) and T_(35) so that they observe the two-
phase locking protocol. (40 points)
Here are some instructions you can use:
Lock-S(A)
Lock-S(B)
Lock-X(A)
Lock-X(B)
Unlock(A)
Unlock(B)
Can the execution of these transactions result in a deadlock? (Just Yes or No)(5 points)
Consider the following two transactions: T _ ( 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!