Consider the following schedule for transactions T1, T2 , these transactions have two phase locking:
T1: |
lock- S(A)
Read (A)
Lock –X (B)
Read (B)
B = A +B
Write (B)
Unlock (A)
Unlock(B) |
T2 |
lock-X(A)
Lock- S(B)
write (A)
Read (B)
Unlock(A)
Unlock(B) |
$$\begin{array}{||l|} \hline T1: & \text{Lock_S(A)} \\ & \text{Read (A)} \\ & \text{Lock _X (B)} \\ & \text{Read (B)} \\ & \text{B = A + B} \\ & \text{Write (B)} \\ & \text{Unlock (A)} \\ & \text{Unlock(B)} \\ \hline T2: & \text{Lock_X(A)} \\ & \text{Lock_S(B)} \\&\text{Write(A)} \\ & \text{Read(B)} \\ & \text{Unlock(A)} \\ & \text{Unlock(B)} \\ \hline \end{array}$$
Which one of the statements below is the correct statement about T1 and T2?
- T1 and T2 are deadlock free
- T1 and T2 results in a deadlock
- T1 and T2 are serial schedule
- none of the above