Transactional memory
Encyclopedia
Transactional memory attempts to simplify parallel programming by allowing a group of load and store instructions to execute in an atomic
way. It is a concurrency control
mechanism analogous to database transaction
s for controlling access to shared memory
in concurrent computing
.
Software transactional memory
provides transactional memory semantics in a software runtime library
or the programming language, and requires minimal hardware support (typically an atomic compare and swap operation, or equivalent).
Load-link/store-conditional
(LL/SC) offered by many RISC processors can be viewed as the most basic transactional memory support. However, LL/SC usually operates on data that is the size of a native machine word.
In the code, the block defined by "transaction" has the atomicity, consistency and isolation guarantees and the underlying transactional memory implementation must assure those guarantees transparently.
Linearizability
In concurrent programming, an operation is atomic, linearizable, indivisible or uninterruptible if it appears to the rest of the system to occur instantaneously. Atomicity is a guarantee of isolation from concurrent processes...
way. It is a concurrency control
Concurrency control
In information technology and computer science, especially in the fields of computer programming , operating systems , multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.Computer...
mechanism analogous to database transaction
Database transaction
A transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...
s for controlling access to shared memory
Shared memory
In computing, shared memory is memory that may be simultaneously accessed by multiple programs with an intent to provide communication among them or avoid redundant copies. Depending on context, programs may run on a single processor or on multiple separate processors...
in concurrent computing
Concurrent computing
Concurrent computing is a form of computing in which programs are designed as collections of interacting computational processes that may be executed in parallel...
.
Hardware vs. software transactional implementations
Hardware transactional memory systems may comprise modifications in processors, cache and bus protocol to support transactions.Software transactional memory
Software transactional memory
In computer science, software transactional memory is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. A transaction in this context is a piece of code that...
provides transactional memory semantics in a software runtime library
Runtime library
In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the execution of a computer program...
or the programming language, and requires minimal hardware support (typically an atomic compare and swap operation, or equivalent).
Load-link/store-conditional
Load-Link/Store-Conditional
In computer science, load-link and store-conditional are a pair of instructions that together implement a lock-free atomic read-modify-write operation....
(LL/SC) offered by many RISC processors can be viewed as the most basic transactional memory support. However, LL/SC usually operates on data that is the size of a native machine word.
Motivation
The motivation of transactional memory lies in the programming interface of parallel programs. The goal of a transactional memory system is to transparently support the definition of regions of code that are considered a transaction, that is, that have atomicity, consistency and isolation requirements. Transactional memory allows writing code like this example:In the code, the block defined by "transaction" has the atomicity, consistency and isolation guarantees and the underlying transactional memory implementation must assure those guarantees transparently.
Implementations
- Rock processorRock processorRock was a multithreading, multicore, SPARC microprocessor developed at Sun Microsystems. Now canceled, it was a separate development from the CoolThreads/Niagara family of processors....
(canceled by OracleOracle CorporationOracle Corporation is an American multinational computer technology corporation that specializes in developing and marketing hardware systems and enterprise software products – particularly database management systems...
) - Vega 2 from Azul SystemsAzul SystemsAzul Systems, Inc., a privately held company, develops runtime platforms for executing Java-based applications. Founded in March 2002, Azul Systems is headquartered in Sunnyvale, California, with offices in Slough, United Kingdom; Tokyo, Japan and Bangalore, India.- Products :Azul produces Zing, a...
- BlueGene/Q processor from IBMIBMInternational Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...
External links
- Transactional Memory Online: Categorized bibliography about transactional memory