programs employ low-level programming constructs that are just a thin
veneer over the underlying hardware.
These constructs consist of threads,
which are an abstract processor, and
explicit synchronization (for example,
locks, semaphores, and monitors) to
coordinate thread execution. Considerable experience has shown that parallel programs written with these constructs are difficult to design, program,
debug, maintain, and—to add insult to
injury—often do not perform well.
Transactional memory (TM)—
proposed by Lomet19 and first practically
implemented by Herlihy and Moss13—
is a new programming construct that
offers a higher-level abstraction for
writing parallel programs. In the past
few years, it has engendered consider-
able interest, as transactions have long
been used in databases to isolate concurrent activities. TM offers a mechanism that allows portions of a program
to execute in isolation, without regard
to other, concurrently executing tasks.
A programmer can reason about the
correctness of code within a transaction and need not worry about complex
interactions with other, concurrently executing parts of the program. TM offers
a promising, but as yet unproven mechanism to improve parallel programming.
What is transaction memory?
A transaction is a form of program execution borrowed from the database
community. 8 Concurrent queries conflict when they read and write an item in
a database, and a conflict can produce
an erroneous result that could not arise
from a sequential execution of the queries. Transactions ensure that all queries produce the same result as if they
executed serially (a property known as
“serializability”). Decomposing the semantics of a transaction yields four requirements, usually called the “ACID”
isolation, and durability.
TM provides lightweight transactions for threads running in a shared
address space. TM ensures the atomicity and isolation of concurrently executing tasks. (In general, TM does not
provide consistency or durability.) Atomicity ensures program state changes
effected by code executing in a transaction are indivisible from the perspective of other, concurrently executing