A schedule $T_1$ is said to be conflict equivalent to another schedule if we can obtain $T2$ from $T1$ by swapping non-conflicting instructions.
$T1$ |
$RA$ |
|
|
$RC$ |
|
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
|
$RB$ |
$WB$ |
|
$RD$ |
|
$WC$ |
|
|
$COMMIT$ |
A. let us try to get option $A$ by swapping non-conflicting instructions
$T1$ |
$RA$ |
|
|
$RC$ |
|
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
|
$RB$ |
$WB$ |
|
$RD$ |
|
$WC$ |
|
|
$COMMIT$ |
We can swap $RA$ with $RB$
$T1$ |
|
$RA$ |
|
$RC$ |
|
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
$RB$ |
|
$WB$ |
|
$RD$ |
|
$WC$ |
|
|
$COMMIT$ |
We can swap $RA$ with $WB$
$T1$ |
|
|
$RA$ |
$RC$ |
|
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
$RB$ |
$WB$ |
|
|
$RD$ |
|
$WC$ |
|
|
$COMMIT$ |
We can swap $RC$ with $RD$
$T1$ |
|
|
$RA$ |
|
$RC$ |
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
$RB$ |
$WB$ |
|
$RD$ |
|
|
$WC$ |
|
|
$COMMIT$ |
We can swap $RA$ with $RD$
$T1$ |
|
|
|
$RA$ |
$RC$ |
$WD$ |
|
$WB$ |
$COMMIT$ |
|
$T2$ |
$RB$ |
$WB$ |
$RD$ |
|
|
|
$WC$ |
|
|
$COMMIT$ |
We can swap $WB$ with $WC$
$T1$ |
|
|
|
$RA$ |
$RC$ |
$WD$ |
$WB$ |
|
$COMMIT$ |
|
$T2$ |
$RB$ |
$WB$ |
$RD$ |
|
|
|
|
$WC$ |
|
$COMMIT$ |
$\therefore$ we have obtained schedule given in $A$ from schedule given in question , hence it is correct answer.
B.
$T1$ |
$RA$ |
$RC$ |
$WD$ |
$WB$ |
|
|
|
|
$COMMIT$ |
|
$T2$ |
|
|
|
|
$RB$ |
$WB$ |
$RD$ |
$WC$ |
|
$COMMIT$ |
In question there was conflict from $R_2B \rightarrow W_1B$ but in this option the conflict is swapped i.e. $W_1B \rightarrow R_2B$
Hence it is incorrect.
C
$T1$ |
$RA$ |
$RC$ |
$WD$ |
|
|
|
$WB$ |
|
$COMMIT$ |
|
$T2$ |
|
|
|
$RB$ |
$WB$ |
$RD$ |
|
$WC$ |
|
$COMMIT$ |
In question there was conflict from $R_2D \rightarrow W_1D$ but in this option the conflict is swapped i.e. $W_1D \rightarrow R_2D$
Hence it is incorrect.
D.
$T1$ |
|
|
|
|
$RA$ |
$RC$ |
$WD$ |
$WB$ |
$COMMIT$ |
|
$T2$ |
$RB$ |
$WB$ |
$RD$ |
$WC$ |
|
|
|
|
|
$COMMIT$ |
In question there was conflict from $R_1C \rightarrow W_2C$ but in this option the conflict is swapped i.e. $W_2C \rightarrow R_1C$
Hence it is incorrect.