You are on page 1of 2

CONCURRENCY CONTROL ALGORITHMS 507

imply ignore it. This is sufficient to enforce synchronization among writes because the
obsolete write request is the same as executing all writes in their
effectof 1gnoring an
timestamp order. However, an additional mechanism is needed for synchronization
hetween reads and wntes because TWR takes care of only write-write synchronization.
the
Note that TWR is an improvement over the BTO algorithm because it reduces
transaction aborts.
number of

20.4.3 Multiversion Timestamp Ordering Algorithm


history of a set of R-ts's and
In the multiversion timestamp ordering (MTO) algorithm, a

W-ts, value> pairs (called versions) is kept for each data object at the respective
DM's. The R-ts's of a data object keep track of the timestamps of all the executed
value or all
read operations, and the versions track of the timestamp and the
keep
actions are executed in the following
the executed write operations. Read and write
manner.

version of x with the largest


A read(x, TS) requ>st is executed by reading the is
the x's set of R-ts's. A read request
timestamp less than TS and adding TS to
never rejected.

the version <12,


18) is executed by reading
Example 20.7. In Fig. 20.7(a), read(x. in
a

V2> and the resulting history


is shown Fig. 20.7(b).

exists a R-ts(x)
executed in the following way: If there
A write(x, v, TS) request is then the write
the smaliest W-ts(x) that is larger than TS,
in the interval from TS to version of x is created with
time-
is accepted and a new
is rejected, otherwise it
stamp TS.

<12, V2>
<W-ts, value><7, Vi>

time

R-ts 9
read(x, 18)
(a)

write(x, V, 15)

<12, V2>
<W-ts, value > <7, V1>
time
18 21
R-ts 4
9
(b)
FIGURE 20.7
An example of MTO.
08 ADVANCED CONCEPTS IN OPERATING SYSTEMS

Example 20.8. In Figure 20.7(b), write(x, V, 15) is rejected because a read with
timestamp 18 has already been executed. However, a write(x. V, 22) is accepted and
is executed by creating a version <22, V> in the history.

is
It can be shown that the MTO algorithm is correct; i.e., every execution
reduces the
equiv-
number
lent to a serial execution in timestamp order. The MTO algorithm
f transaction aborts over the BTO and TWR algorithms. It does, however, require a
versions of data objects are
uge amount of storage, as a set of R-ts's and multiple
all versions of data objects-techniques
ept for data objects. It is not practical to keep
xist to delete old versions.

You might also like