CS 5614 Homework #7

Date Assigned: November 12, 1999
Date Due: November 19, 1999, in class, before class starts

  1. (5*4=20 points) Consider the two transactions:

    • Transaction 1: TransferBalance
      • READ(A,x);
      • x = x-50;
      • WRITE(A,x);
      • READ(B,y);
      • y = y+50;
      • WRITE(B,y);

    • Transaction 2: ReportSum
      • READ(A,x);
      • READ(B,y);
      • print x+y;

    For the following questions, take into account all operations, even operations like "x=x-50" and "print x+y" etc. Count the number of:

    • Interleavings of the above two schedules (all combinations)
    • Serial Schedules
    • Serializable Schedules. Explain what a good consistency constraint for this problem would be.
    • Conflict-Serializable Schedules

    FAQ: Why do we have to take into account operations like "x = x-50"? Didn't we learn that we have to be concerned with only reads and writes?

    Answer: That's correct but the goal of this exercise is to give you practice in "counting". So, including them makes the problem more trickier! :-)

  2. (20 points) Consider the two transactions:

    T_1 : r_1(A), r_1(B), inc_1(A), inc_1(B)
    T_2 : r_2(A), r_2(B), inc_2(A), inc_2(B)

    where inc_1(A) refers to an increment of A by transaction 1 and so on. Notice that the quantity of the increment is unknown. For example, inc_1(A) could mean "increment by 1", "increment by 10" or "increment by B", or something else. So, you cannot assume anything. How many interleavings of these transactions are conflict-serializable? If the order of the increments in T_2 are reversed, how many interleavings are conflict-serializable?

  3. (20 points) Consider the compatibility matrix for S,X,IS,IX and SIX locks. Extend this compatibility matrix so that it also accomodates "increment" locks. Look also to see if the new locks that you add completely dominate others. If not, explain if you have to introduce "hybrid locks" such as SIX.

    Warning: This question is difficult!!


Return Home