Causality example execution

Viewed 98

The link gives an example of allowed legal execution. Please refer to page 26 section 4.8.1 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.79.629&rep=rep1&type=pdf.

The example is

Initially,
x = y = 0
Thread 1  Thread 2
r1 = x;   r2 = y;
y = 1;    x = r2;
r1 == r2 == 1 is a legal behavior

From paper,

We wish the action r2 = y to see the value 1. C 1 cannot contain this action seeing this value: neither write to y had been committed. C 2 may contain this action; however, the read of y must return 0 in E 2 , because of Rule 6. Execution E 2 is therefore identical to E 1
In E 3 , by Rule 7, r2 = y can see any conflicting write that occurs in C 2 (as long as that write is happens-before consistent). This action can now see the write of 1 to y in Thread 1, which was committed in C 1 . We commit one additional action in C 3 : a write of 1 to x by x = r2 .

We can't commit r2=y where value of y is 1 because read of y will return 0 according to rule 6. But according to the paper in the next commit cycle in E3, r2=y can see the value y=1 which is committed in Thread1. My doubt is execution E3 for committing r2=y should also satisfy the rule 6 and should only see the value happened before it, that is the x=0. Why is that in E2 because of rule 6 while committing r2=y, y can only read y value as 0 but in E3 while committing r2=y, y can read the y=1 written in Thread1?

1 Answers
Related