Is R - W a conflict ??

22 votes

Consider the following four schedules due to three transactions (indicated by the subscript) using *read *and *write *on a data item x, denoted by $r(x)$ and $w(x)$ respectively. Which one of them is conflict serializable?

- $r_1(x)$; $r_2(x)$; $w_1(x)$; $r_3(x)$; $w_2(x)$;
- $r_2(x)$; $r_1(x)$; $w_2(x)$; $r_3(x)$; $w_1(x)$;
- $r_3(x)$; $r_2(x)$; $r_1(x)$; $w_2(x)$; $w_1(x)$;
- $r_2(x)$; $w_2(x)$; $r_3(x)$; $r_1(x)$; $w_1(x)$;

22 votes

Best answer

0

0

Here there is No unrepeatable read in any of the 4 options . Then How can one get cycles in all the graphs . Could some one explain it in a nice manner .

6

take node for evry transaction

procedure is simple scan left to right for

take first element => scan from 2nd elemnt to right for every r-w . w-w or w-r conflict in diffrent transaction thier is a edge

take 2nd element => scan from 3rd elemnt to right for every r-w . w-w or w-r conflict in diffrent transaction thier is a edge

do like this skip left side one elemnt evry time.

if u found cycle then not css otherwise css.

6 votes

In option D, there is no interleaving of operations. The option D has first all operations of transaction 2, then 3 and finally 1 There can not be any conflict as it is a serial schedule with sequence 2 --> 3 -- > 1