|
Distributed Computing This website demonstrates using wikis as teaching and learning tool. The course instructor is also happy to share the teaching materials here with those who find it readable. |
Tutorial /
TransactionsTransactions Basics
Concurrent Execution of TransactionsConsider the following three transactions. Suppose the initial balances of the three accounts A, B, and C are $400 each. Transaction T transfers $100 from Account A to Account B. Transaction U transfers $300 from Account C to Account B. Transaction V calculates the total amount of Accounts A, B, and C. Transaction T:
balanceT1 = READ(A);
WRITE(A, balanceT1-100);
balanceT2 = READ(B);
WRITE(B, balanceT2+100);
Transaction U:
balanceU1 = READ(C);
WRITE(C, balanceU1-300);
balanceU2 = READ(B);
WRITE(B, balanceU2+300);
Transaction V:
total = READ(A);
total = total + READ(B);
total = total + READ(C);
Serially Equivalent and Order of conflicting OperationsConsider two transactions T and U as defined in the following. T: x = read(j); y = read(i); write(j,44); write(i,33). U: x = read(k); write(i,55); y = read(j); write(k,66).
Serially Equivalent and Order of conflicting OperationsConsider two transactions T and U as defined in the following. T: y = read(k); x = read(i); write(j,22); U: write(i,33); write(j,44);
|