In the context of concurrency control, a given pair of operations in a schedule is called conflict schedule if
(A) At least one of the operations is write operation
(B) Both the operations are performed on the same data item
(C) Both the operations are performed by different transactions
(D) Both the operations are performed on different data items
Choose the correct answer from the options given below:
Solution
The correct answer is option 2.
Key Points
Two functions are said to be incompatible if any of the following conditions are met:
- They are associated with various transactions.
- They both work with the same data object.
- One of them must be a write operation.
If you note the issues mentioned below, it's because different transactions have performed at least one write operation on the same data object.
a) Item X has an incorrect value because its update by T1is lost(overwritten).
| T1 |
T2 |
|
read_item(X);
X=X-N;
write_item(X);
read_item(Y);
Y=Y+N;
write_item(Y);
|
read_item(X);
X=X+m;
write_item(X);
|
b) Transaction T1 fails and must change the value of X back to its old value; meanwhile, T2 has read the temporary incorrect value of x.
| T1 |
T2 |
|
read_item(X);
X=X-N;
write_item(X);
read_item(Y);
|
read_item(X);
X=X+m;
write_item(X);
|
c)T3 reads X after N is subtracted and reads Y before N is added; a wrong summary is a result(off by N).
| T1 |
T3 |
|
read_item(X);
x=x-N;
write_item(X);
read_item(Y);
Y=Y+N;
write_item(Y);
|
sum=0
read_item(A);
sum=sum+A;
.
.
read_item(X);
sum=sum+X;
read_item(Y);
sum=sum+Y;
|
∴ Hence the correct answer is (A), (B) and (C) only