3,624 views
3 votes
3 votes

Consider the following schedule:

The possible values of P & Q for which the above schedule is allowed under Thomas write rule but not under basic timestamp ordering protocol if timestamp(T2 )>timestamp(T1 )

  1.   W(B),W(C)
  2.   W(A),W(A)
  3.   Both (a)&(b)
  4.   None of these

2 Answers

6 votes
6 votes

Answer : 4 (None)


Thomas’ write rule :

Suppose that transaction Ti issues write(Q).

1. If TS(Ti) < R-timestamp(Q), then the value of Q that Ti is producing was previously needed, and it had been assumed that the value would never be produced. Hence, the system rejects the write operation and rolls Ti back.

2. If TS(Ti) < W-timestamp(Q), then Ti is attempting to write an obsolete value of Q. Hence, this write operation can be ignored.

3. Otherwise, the system executes the write operation and sets W-timestamp(Q) to TS(Ti).



Thus, None of the options A and B is correct. Because A makes the schedule legal under both Basic TSO protocol and Thomas write TSO protocol.

And B makes the schedule illegal under both Basic TSO protocol and Thomas write TSO protocol because when T1 issues W(A) in Q statement, then according to Condition_1 of Thomas Rule TS(T1) < (Read_TS(A) = TS(T2))  thus , the system rejects the write operation and rolls T1 back.

So, The correct answer is None.

4 votes
4 votes

Option 1 : We haven't any W->W or W->R or R->W dependency from T2 to T1, So Option 1 is valid for Simple TimeStamp. and so, valid for TWR (bcz in TWR we can even ignore W->W dependency).

Option 2 : There will be W(A)->W(A) dependency from T2 to T1, which voilate Simple TimeStamp Rule but valid for TWR (bcz TWR will be voilate only if W->R or R->W dependency is here from T2 to T1)

So Option 2

Note: It should be given that TimeStamp of T2 is greater than that of T1.

Related questions

0 votes
0 votes
1 answer
1
1 votes
1 votes
0 answers
2
Karishma Datt asked Jul 24, 2022
414 views
Need some help , In this question W3(B) , W2(B) is allowed in TWR bit confuse between option b and d . Plz help me which option is correct between b and d with proper jus...
1 votes
1 votes
1 answer
3
aditi19 asked Dec 1, 2018
1,933 views
there is a schedule which is allowed in Thomas write rule so it is view serializable. Suppose at a point write operation of an older transaction is ignored. then the same...
0 votes
0 votes
0 answers
4
akshayaK asked Dec 9, 2018
601 views
what do you mean by outdated writes ?we ignore outdated writes in TWR, what do we mean by this ??from this, which of this allowed under TWR and not Basic Timestamp ?anyon...