Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
132 views
in Programming by (103k points)
closed by

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:


1. (A) and (B) only
2. (A), (B) and (C) only
3. (A), (C) and (D) only
4. (C) and (D) only

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 2 : (A), (B) and (C) only

The correct answer is option 2.

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

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...