Question: Task#2Concurrency Control 1. Consider the following two transactions: T1: read(A); read(B); if A = 0 then B: = B + 1; write(B). T2: read(B); read(A);
Task#2Concurrency Control 1. Consider the following two transactions: T1: read(A); read(B); if A = 0 then B: = B + 1; write(B). T2: read(B); read(A); if B = 0 then A: = A + 1; write(A). a. Add lock and unlock instructions to transactions T1 and T2, so that they observe the two-phase locking protocol. b. Can the execution of these transactions result in a deadlock?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
