Fact-checked by Grok 2 weeks ago

Software transactional memory

Software transactional memory (STM) is a non-blocking software-based mechanism that allows programmers to execute sequences of operations on shared data structures as transactions, ensuring , , and without relying on traditional locks or hardware support. Transactions in STM are finite sequences of read and write operations that speculatively execute in , logging changes privately until a commit attempt, at which point conflicts with concurrent transactions trigger aborts and retries to maintain . This approach draws inspiration from database transactions but applies them to in-memory data, using primitive operations like to manage contention. The concept of transactional memory originated with the 1993 proposal by Maurice Herlihy and J. Eliot B. Moss for hardware transactional memory (HTM), which aimed to provide architectural support for lock-free data structures by extending protocols to handle multi-word atomic operations. Building on this foundation, was introduced in 1995 by Nir Shavit and Dan Touitou as a portable, software-only alternative that leverages existing hardware primitives like load-linked/store-conditional to implement dynamic or static transactions without specialized processors. Early motivations included overcoming the limitations of lock-based , such as deadlocks, priority inversion, and poor scalability in multiprocessor environments, while simplifying the development of concurrent programs. STM systems typically employ , where transactions proceed assuming no s, buffering writes in thread-local logs and validating them against global state during commit; upon detection of a read-write or write-write , the transaction aborts and restarts. Key design variations include object-based versus word-based implementations, eager versus lazy detection, and support for dynamic transactions that access unbounded sets. Pioneering systems like DSTM (Dynamic STM) by Herlihy et al. introduced obstruction-free progress guarantees and features such as invisible reads to reduce contention, while others like FSTM emphasized lock-free helping mechanisms for better . Among STM's primary advantages are its composability—allowing fine-grained transactions to nest or compose without explicit lock —and resilience to programming errors that plague locking, such as forgotten unlocks leading to deadlocks. However, challenges persist, including overhead from , validation, and retries, which can degrade performance under high contention compared to fine-grained locking. Despite these, STM has influenced modern languages like and , and hybrid approaches combining STM with hardware TM continue to evolve for .

Overview

Definition and Basic Concepts

Software transactional memory (STM) is a software-based mechanism that allows multiple threads to execute blocks of code atomically and in isolation by treating groups of read and write operations on as , thereby simplifying parallel programming without the need for explicit locks. In this model, a transaction is a finite sequence of memory operations that must appear to execute indivisibly from the perspective of other , ensuring that either all operations succeed (commit) or none do (abort), with changes rolled back in the latter case. The commit phase atomically installs the transaction's updates into upon successful validation, while an abort discards all modifications and restarts the transaction if necessary. The basic workflow of STM relies on optimistic concurrency control, where transactions proceed assuming no conflicts, buffering writes locally or using versioning to track changes. During execution, reads and writes are performed on shared data, often mediated by ownership records or to detect concurrent access; conflicts arise when another transaction has modified a location read by the current one or vice versa. Conflict detection typically occurs lazily at commit time through validation (e.g., checking version numbers) or eagerly during reads/writes, triggering an abort and retry mechanism to resolve inconsistencies without blocking other threads. This process provides atomicity and , akin to database , though implementations vary in their use of fine-grained locking, non-blocking primitives like , or timestamping for conflict management. A simple pseudocode example illustrates a transactional read-modify-write operation, such as incrementing a shared counter:
atomic {
    val = read(counter);  // Read current value
    new_val = val + 1;    // Local computation
    write(counter, new_val);  // Buffered write
}  // Implicit commit or abort
In this construct, the atomic block delimits the transaction; upon commit, the increment is applied atomically if no conflicts are detected, otherwise the transaction aborts and retries from the read.

History and Evolution

The concept of transactional memory drew early inspiration from models developed in the , which ensured atomicity, consistency, isolation, and durability ( properties) for concurrent data access. This analogy influenced proposals for hardware transactional memory () in the 1990s, aiming to simplify lock-free synchronization in multiprocessor systems. A seminal contribution was the 1993 paper by Maurice Herlihy and J. Eliot B. Moss, which introduced transactional memory as an architectural mechanism to enable , treating groups of memory operations as buffered in a transaction buffer and committed or aborted as a whole. The shift to software-only transactional memory (STM) occurred in 1995, when Nir Shavit and Dan Touitou proposed a non-blocking that simulated hardware transactions using fine-grained locking and versioning on shared data structures. This work established STM as a portable alternative to hardware , focusing on dynamic transactions where accessed objects are not predetermined. Building on this foundation, the early saw practical implementations emerge; notably, Tim Harris and Keir Fraser developed a word-based STM library for in 2003, incorporating optimistic concurrency with dynamic ownership tracking to manage conflicts efficiently. Concurrently, the concept of obstruction-free progress gained prominence through related non-blocking synchronization research, emphasizing liveness guarantees without assuming fairness among threads. Advancements in the mid-2000s included optimizations for and suitability. In , Torvald Riegel, Christof Fetzer, and Pascal Felber introduced time-based validation techniques in STM designs, using hardware clocks to reduce contention and enable predictable abort rates in multiprocessor environments. These efforts coincided with integrations that popularized STM: Haskell incorporated composable STM in its Glasgow Haskell Compiler (GHC) version 6.4 in 2005, allowing pure with atomic blocks for thread-safe state updates. Clojure followed in 2008 with built-in support for STM via refs and dosync blocks, emphasizing for immutable data in dynamic environments. Standardization of evaluation came with STMBench7 in 2007, a simulating complex workloads like CAD/CAM applications to compare STM against locking baselines across traversal, navigation, and update operations. Post-2020 developments reflected growing multicore complexity and hardware integration, with a pivot toward hybrid STM-HTM systems to leverage best-effort while falling back to software for long or conflicting transactions. Scalability challenges in large-scale multicore systems drove research into contention management and reduced overhead. A notable example is PIM-STM in 2024, which adapts algorithms for processing-in-memory (PIM) architectures like UPMEM, enabling efficient transactional execution directly in to mitigate data movement bottlenecks and support irregular access patterns. Other recent works include for fast ordered maps (2024) and Transactional Lock Fusion for integrating with lock-based structures (2025).

Core Principles

Transactional Properties

Software transactional memory (STM) draws inspiration from database transactions, adapting the properties to provide guarantees for concurrent program execution. Atomicity ensures that a transaction executes as an indivisible unit: either all its operations complete successfully, or none of the changes take effect, achieved through techniques like deferred updates or mechanisms in STM systems. Consistency requires that each transitions the system from one valid to another, preserving application-specific invariants, though STM typically delegates this to the programmer rather than enforcing it mechanically. prevents interference between concurrent transactions, making their effects appear as if they executed sequentially, while —ensuring committed changes persist beyond failures—is often omitted in pure STM implementations, as it relies on external persistence mechanisms rather than core STM semantics. The standard isolation level in STM is serializability, which guarantees that the outcome of concurrent transactions is equivalent to some sequential execution of those transactions, preserving the real-time order of non-overlapping transactions. This is typically enforced through , where transactions proceed without locks and are validated for conflicts before commit. For stronger guarantees, some STM designs aim for opacity, an extension of serializability that also ensures aborted transactions do not observe inconsistent intermediate states, or even at the transaction level, where committed transactions appear to take effect instantaneously relative to their invocation and response times. STM systems detect conflicts to maintain these properties, primarily focusing on read-write conflicts (where one transaction reads data later written by another) and write-write conflicts (where two transactions write to the same location). These are identified using mechanisms such as timestamps, where each reads a version number on access and validates it against a global clock at commit to detect intervening writes, or signatures—compact Bloom filter-like representations of read and write sets—that allow efficient conflict checks without per-object . For instance, the TL2 employs timestamp-based validation at commit time to resolve read-write and write-write conflicts lazily, aborting that encounter inconsistencies. To ensure practical usability, STM implementations provide progress conditions that guarantee forward movement under varying concurrency. Obstruction-freedom, the minimal non-blocking guarantee, ensures that a transaction makes progress if it encounters no interference from other transactions, though it permits livelock in highly contended scenarios. Stronger variants include lock-freedom, where at least one transaction in the system progresses indefinitely, preventing system-wide stalls, and starvation-freedom, achieved via adaptive contention managers that prioritize or back off conflicting transactions to bound retries for any individual transaction. These conditions enable STM to support composable operations without traditional lock hierarchies, though they may require application-level handling of aborts.

Composable Operations

Software transactional memory (STM) treats transactions as first-class units, allowing them to be nested or composed modularly without requiring explicit mechanisms between them. This enables developers to assemble complex operations from simpler, independent transactional blocks, preserving and atomicity across the . Unlike traditional locking, where must be managed manually at module boundaries, STM's approach respects barriers, permitting the reuse of transactional code without exposing internal locking details. Nested transactions extend this by embedding one within another, facilitating hierarchical in concurrent programs. In closed nesting, the effects of an inner are not visible to other transactions until the outermost commits; the inner transaction's read and write sets are merged with the parent's upon successful commit, but an abort of the inner simply discards its sets without propagating failure to the outer one unless explicitly handled. For instance, if an inner closed-nested attempts to update a shared but conflicts with another , it aborts independently, allowing the outer to or proceed with alternative logic. In contrast, open nesting makes the inner transaction's successful effects immediately visible, enhancing concurrency by releasing resources early while using abstract locks to detect logical conflicts; however, an abort here may invoke compensation handlers to undo changes in the outer transaction's state, potentially leading to a full if unresolvable. This distinction allows open nesting to avoid the visibility delays of closed nesting, though it requires careful handler design to maintain correctness. Composition in STM can be dynamic or static, with dynamic approaches enabling assembly of transactional through like execution paths or retry policies. Dynamic , for example, uses constructs such as orElse to chain transactions where a failure in one triggers execution of another, allowing without compile-time decisions. Static , by , involves predefined nesting structures resolved at , offering predictability but less flexibility for variations. The properties of ensure that dynamically composed transactions maintain atomicity as if executed sequentially, though this relies on conflict detection to resolve interferences. These features yield significant benefits, particularly in refactoring and , as transactional units can be composed orthogonally to their internal implementations, avoiding the error-prone adjustments needed with fine-grained locks. For example, a providing a transactional insert can be reused within a larger updating multiple structures, without the developer needing to coordinate lock orders or handle deadlocks explicitly. This reduces complexity in concurrent programming, enabling scalable designs that are easier to maintain and extend compared to lock-based alternatives. Example Pseudocode for Composing Transactions: The following pseudocode illustrates composing two independent transactions—a balance check and a transfer—into a larger unit using dynamic composition with alternatives:
atomic {
  do
    t1 <- checkBalance(account1)  // Transactional read
    if t1.balance < amount then
      retry  // Block until balance changes
    else
      return
  orElse
    abort "Insufficient funds"

  t2 <- transfer(account1, account2, amount)  // Nested transactional update
  if not t2 then
    abort "Transfer failed"
}
Here, the outer atomic block composes checkBalance and transfer dynamically; if the balance check retries, the transfer is deferred until resolution, ensuring the entire operation is atomic.

Synchronization Comparisons

Versus Traditional Locking

Traditional locking mechanisms, such as mutual exclusion locks (mutexes) and reader-writer locks, provide synchronization by enforcing exclusive access to shared resources, preventing concurrent modifications but often at the cost of reduced parallelism. These approaches require programmers to explicitly acquire and release locks around critical sections, which can lead to issues like priority inversion and excessive contention if not carefully managed. A significant drawback of locking is its susceptibility to deadlocks, where threads hold locks while waiting for others, forming circular dependencies that halt progress; mitigation typically involves imposing strict lock acquisition hierarchies or timeouts, adding complexity to program design. In contrast, software transactional memory (STM) employs an optimistic concurrency control strategy, allowing transactions to proceed without initial locking and speculatively executing operations on shared memory, only validating and committing changes at the end if no conflicts occurred. This differs from the pessimistic nature of traditional locks, which assume conflicts and block threads preemptively to serialize access, potentially underutilizing system resources in low-contention scenarios. With STM, programmers demarcate atomic blocks without explicit acquire or release statements, as the runtime system handles conflict detection through versioning or ownership tracking, aborting and retrying conflicting transactions as needed. STM inherently avoids deadlocks by forgoing persistent locks altogether; instead of blocking indefinitely, conflicting transactions are aborted, enabling progress through retries without the need for hierarchical ordering or manual intervention. Traditional locking, however, demands careful discipline to prevent such cycles, often complicating code maintenance and debugging. Regarding granularity, coarse-grained locks protect large sections of code or data structures, minimizing overhead but increasing contention and serialization; fine-grained locks reduce this by targeting smaller units but raise the risk of deadlocks and overhead from numerous lock operations. STM dynamically adjusts effective granularity based on actual conflicts, allowing concurrent access to non-overlapping data within transactions and promoting finer parallelism without programmer-specified lock scopes. This flexibility contrasts with locking's static granularity choices, which often require tuning for specific workloads. To illustrate, consider a simple bank account transfer operation, which must atomically deduct from one account and add to another to maintain consistency. A lock-based implementation requires explicit mutex acquisition on both accounts, ordered to avoid deadlocks:
pseudocode
mutex lockA = accountA.lock;
mutex lockB = accountB.lock;
if (accountA.id < accountB.id) {
    acquire(lockA);
    acquire(lockB);
} else {
    acquire(lockB);
    acquire(lockA);
}
accountA.balance -= amount;
accountB.balance += amount;
release(lockB);
release(lockA);
In STM, the same logic is encapsulated in an atomic block, with no manual locking or ordering:
pseudocode
atomic {
    accountA.balance -= amount;
    accountB.balance += amount;
}
This STM approach simplifies composition, as nested or sequential transactions integrate seamlessly without propagating lock concerns.

Versus Other Concurrency Models

Software transactional memory (STM) differs fundamentally from message-passing models, such as those used in or , in its approach to concurrency. While STM enables optimistic access to shared memory through atomic transactions that detect and resolve conflicts via aborts and retries, message-passing models avoid shared state entirely by facilitating asynchronous communication between isolated processes or tasks. This makes message-passing particularly suitable for distributed systems like clusters, where synchronization occurs explicitly through message exchanges, eliminating the need for conflict detection but potentially introducing latency in communication-heavy scenarios. In contrast, STM thrives in shared-memory environments, such as multicore processors, by simplifying the composition of concurrent operations without the overhead of explicit messaging. The actor model, exemplified by frameworks like Akka, further contrasts with STM by encapsulating state within isolated actors that interact solely through asynchronous message passing, thereby preventing direct shared-memory access and inherent data races. Actors maintain private state per entity, promoting scalability in distributed or parallel settings but requiring careful message orchestration for coordination, which can lead to non-determinism from scheduling variability. STM, however, permits optimistic shared access across transactions, offering finer-grained composability for operations on common data structures while relying on runtime validation to ensure isolation and atomicity. Although both models support parallelism without traditional locks, the actor model's avoidance of shared state reduces contention but limits expressiveness for tightly coupled computations compared to STM's transactional boundaries. Read-copy-update (RCU) provides another alternative, emphasizing low-overhead reads in read-mostly workloads by allowing concurrent readers to access data without synchronization primitives, while updaters wait for a grace period to ensure reader completion before reclaiming memory. This contrasts with STM's immediate conflict detection through validation logs during transactions, which incurs overhead for both reads and writes to maintain atomicity across arbitrary operations. RCU excels in scenarios like kernel hash tables where reads dominate and updates are infrequent, achieving near-linear scalability without reader-side barriers, whereas STM is better suited for balanced read-write patterns requiring strong consistency guarantees. Enhancements like relativistic programming can bridge this gap by combining RCU-inspired reader optimizations with STM for scalable writes, but pure RCU lacks STM's support for complex, multi-location atomic updates. Barriers and futures/promises represent synchronization primitives that differ from STM's fine-grained transactional model. Barriers enforce global synchronization points where all threads must converge before proceeding, suitable for structured parallelism like parallel loops but inflexible for irregular or nested dependencies. Futures and promises, conversely, handle asynchronous computations by allowing tasks to proceed independently and synchronize only upon result access, focusing on dependency resolution without inherent atomicity for shared state. STM provides transactional boundaries that atomically compose multiple operations on shared data, enabling optimistic execution across fine-grained scopes, whereas futures require explicit integration for consistency in concurrent environments. Hybrid approaches, such as transactional futures, combine these for greater expressiveness, but standalone barriers and futures lack STM's isolation for shared-memory conflicts. STM is particularly advantageous for data-parallel workloads exhibiting irregular access patterns, where static analysis fails to predict dependencies, as seen in graph traversals or dynamic reductions. In such cases, lazy conflict detection in STM reduces aborts and livelocks compared to eager approaches, enabling scalable parallelism on multicore systems without resorting to coarser synchronization. For instance, optimized STM implementations like ReduxSTM extract maximum concurrency from unpredictable data accesses by prioritizing sequential ordering and privatization, outperforming traditional models in contention-prone irregular applications. Thus, STM is preferable when workloads involve frequent, non-uniform shared-memory interactions that benefit from optimistic execution over partitioned or message-based alternatives.

Advantages and Limitations

Conceptual Advantages

Software transactional memory (STM) simplifies parallel programming by enabling developers to demarcate critical sections as atomic transactions, thereby eliminating the need for explicit lock management and reducing synchronization boilerplate. This allows programmers to concentrate on high-level application logic rather than low-level concurrency control, fostering more intuitive and error-free code development. STM improves scalability for concurrent applications, especially those with non-uniform workloads, by mitigating phenomena like lock convoying that cause threads to queue unnecessarily and degrade performance. Unlike traditional locking, which often requires careful granularity tuning to avoid contention hotspots, STM's optimistic execution model permits greater parallelism without predefined access hierarchies, leading to more efficient resource utilization across multiple threads. The inherent composability of STM operations enhances modularity, as concurrent components can be composed and reused independently without synchronization details propagating across modules, thereby easing maintenance, testing, and evolution of parallel software. Additionally, STM bolsters fault tolerance through automatic conflict detection and rollback, which restores consistent state upon failures or exceptions, promoting robustness without manual recovery mechanisms. STM proves particularly advantageous for irregular parallelism, such as graph algorithms or dynamic data structures, where access patterns vary unpredictably and impose challenges for lock-based synchronization. By supporting non-blocking updates to pointer-based structures without conservative locking, STM facilitates flexible concurrency in these domains, enabling efficient parallelization of workloads like shortest-path computations or linked-list manipulations.

Key Disadvantages and Challenges

Software transactional memory (STM) implementations introduce significant runtime overhead due to the need for logging read and write sets, as well as validation checks to detect conflicts, which can result in 2-20x slowdowns compared to traditional locking in low-contention scenarios where conflicts are rare. This overhead arises from the optimistic execution model, where transactions speculatively perform operations and buffer changes until commit time, incurring extra instructions for metadata management even in the absence of contention. Liveness issues represent another key challenge, particularly in high-contention environments, where conflicting transactions may repeatedly abort each other, leading to potential livelock without mechanisms like randomized backoff to ensure progress. In such cases, symmetric read-write or multiple write-write conflicts during validation can trap transactions in endless retries, exacerbating performance degradation and complicating guarantees of forward progress. STM also imposes a notable memory footprint overhead through the allocation of additional metadata structures, such as versioned lock-words or arrays that track changes per memory location, often requiring thread-local lists for read and write sets. These structures, which embed version numbers and lock bits, can consume substantial space in implementations using per-stripe or per-object mappings, further straining resources in memory-constrained systems. Integrating non-transactional code poses substantial challenges, as operations like I/O or legacy non-atomic accesses cannot be reliably included within transactions due to the inability to roll back side effects such as system calls or interrupts. This limitation often requires buffering or separation of transactional and non-transactional regions, complicating program design and potentially violating weak atomicity semantics when shared data is accessed outside transactions. Theoretically, while pure software STM can provide obstruction-freedom, it often lacks stronger universal progress guarantees such as lock-freedom without hardware support or advanced contention managers, relying instead on contention managers that may fail under sustained conflicts. This absence of strong liveness properties means that in adversarial scenarios, transactions may not complete, necessitating fallbacks to locking and limiting STM's applicability in safety-critical or real-time systems.

Implementation Strategies

Software Transactional Memory Techniques

Software transactional memory (STM) implementations rely on optimistic concurrency control, where transactions proceed assuming no conflicts and abort upon detection. Core techniques distinguish between update protocols that determine how writes are handled during transaction execution. Direct-update protocols modify shared memory in-place as writes occur, using undo logs to restore original values if the transaction aborts. This approach enables early visibility of updates to other transactions but risks cascading aborts if a writing transaction fails after others have read its changes. Deferred-update protocols, in contrast, buffer modifications in private structures—such as redo logs or shadow copies—and apply them atomically only upon successful commit. This isolates transactions from one another during execution, minimizing wasted work from premature conflicts, though it incurs higher memory and validation overhead. Representative examples include DSTM, which employs cloned copies for dynamic data structures. Conflict detection mechanisms further classify STM designs as eager or lazy, influencing when incompatibilities between transactions are identified. Eager detection checks for conflicts immediately upon read-write or write-write access attempts, often via metadata like lock bits or ownership flags, aborting the conflicting transaction promptly to avoid inconsistent reads. While this reduces computation on doomed paths, it can cause spurious aborts if the owning transaction later fails. Lazy detection defers checks until commit time, validating the transaction's read and write sets against intervening modifications. This promotes higher concurrency by allowing overlapping execution but may discard substantial progress if a late conflict arises. Many systems combine approaches, such as eager write-write detection with lazy read-write validation, to balance overhead and progress. Supporting these protocols are metadata structures that track transaction state and versions without centralized coordination. Epoch-based metadata assigns global or thread-local epochs to delineate transaction lifetimes, facilitating safe reads and garbage collection by ensuring no active transaction spans multiple epochs. Timestamp-based schemes, like those in TL2, use monotonically increasing global timestamps to order transactions and validate consistency at commit by comparing against read-set versions. Hash-based signatures provide compact representations of read or write sets, enabling efficient conflict detection via bloom filters or checksums without storing full sets. Upon conflict, contention managers orchestrate retries to resolve livelock and ensure progress. Exponential backoff implements polite contention resolution by having the loser delay with exponentially increasing intervals, reducing hot-spot pressure. Randomization perturbs backoff times to desynchronize retries across threads. Priority-based managers, such as Karma, accumulate priority points for longer-running transactions and use queues to favor them, promoting fairness and throughput in unbalanced workloads. A simple eager STM algorithm, as proposed in early non-blocking designs, acquires ownership of memory locations before writing using atomic primitives like load-linked/store-conditional (LL/SC). The following pseudocode illustrates the core transaction logic from Shavit and Touitou's foundational work, where ownerships are acquired in sorted order to prevent deadlocks, and conflicts trigger helping before retry:
Transaction(T, M)  // T: transaction record, M: memory locations
1. Sort M by address
2. For each location L in M:
3.     While true:
4.         Owner = LL(Ownerships[L])  // Load-linked ownership
5.         If Owner == null:
6.             If SC(Ownerships[L], T):  // Store-conditional succeeds
7.                 Break  // Ownership acquired
8.             Else: Continue  // Retry on failure
9.         Else if Owner.Status == committed:
10.            Read from Memory[L]
11.        Else:  // Help complete Owner's transaction
12.            Help(Owner)
13.            Continue
14.    // Now own L; write to Memory[L] and log old value in T.Undo
15. If all acquisitions succeed:
16.    T.Status = committed
17. Else: Abort and undo writes using log
This design ensures atomicity through obstruction-free progress, with helping mitigating livelock.

Transactional Locking Mechanisms

Hybrid transactional memory (HyTM) systems integrate optimistic concurrency control for reads with pessimistic locking for writes to balance performance and correctness in software transactional memory (STM) implementations. In these models, read operations proceed optimistically without acquiring locks, allowing multiple transactions to read shared data invisibly and concurrently, while write operations employ fine-grained locks only at commit time to ensure atomicity and detect conflicts. This approach, exemplified by the TL2 algorithm, enables high reader throughput by avoiding read-time contention, as readers validate their snapshots against a global version clock rather than blocking on locks. Pessimistic write locking then serializes updates, preventing lost updates while minimizing the scope of locking to the write set. Lock elision in HyTM leverages hardware transactional memory (HTM) for speculative execution of lock-based critical sections, with software fallbacks using fine-grained locks to guarantee progress when hardware transactions abort due to conflicts or capacity limits. In this scheme, the compiler or runtime attempts to elide locks by initiating an HTM transaction; if it succeeds, no software locks are needed, providing low-overhead concurrency. Upon HTM failure, the system falls back to a software path that acquires per-object locks in a manner compatible with the original locking discipline, ensuring semantic equivalence to traditional lock-based code. This hybrid strategy, as proposed in early HyTM designs, improves scalability on HTM-enabled hardware like Intel's Restricted Transactional Memory while maintaining portability via lock-based recovery. Refined variants further optimize by instrumenting only conflicting paths, such as writes in reader-writer scenarios, to reduce fallback overhead. Reader-writer transactional locks extend HyTM efficiency by permitting multiple concurrent readers without blocking, akin to traditional reader-writer locks but integrated with transactional semantics. In STM contexts, readers access data via invisible optimistic validation against versions, avoiding any locking and thus allowing unbounded reader concurrency, while writers acquire exclusive locks on their write set at commit to block both readers and other writers during validation and application. This design, central to algorithms like , ensures that read-only transactions complete without contention, boosting performance in read-heavy workloads, whereas write transactions serialize to maintain consistency. Extensions like refine this by explicitly supporting read locks for non-transactional readers, but in pure STM, the optimistic reader model inherently supports multiple non-blocking readers through versioned snapshots. Deadlock prevention in HyTM relies on timeout-based abort mechanisms or hierarchical lock acquisition to avoid cyclic dependencies during the pessimistic phase. Timeouts detect prolonged lock waits, aborting and retrying transactions to break potential deadlocks, as implemented in with bounded spinning on locks. Hierarchical locking enforces a global order—such as sorting memory addresses before acquisition—to prevent cycles, ensuring that transactions always request locks in a consistent sequence regardless of execution order. This approach, analyzed in deadlock detection studies for lock-based , guarantees progress without runtime cycle detection overhead, though it may introduce minor sorting costs at commit. The following pseudocode illustrates a simplified integration of reader-writer locks in a HyTM commit phase, based on TL2 principles, where reads are optimistic and invisible, and writes use ordered locking:
function commitTransaction(readSet, writeSet):
    rv = readGlobalClock()  // Snapshot version for validation
    sort(writeSet)  // Hierarchical order for deadlock avoidance
    
    // Acquire write locks pessimistically (writers block readers/writers)
    for each loc in writeSet:
        if not tryLock(loc) with timeout:  // Bounded wait
            abortTransaction()  // Rollback on failure
        if getVersion(loc) > rv or isLocked(loc):  // Conflict check
            releaseLocks(writeSet)
            abortTransaction()
    
    wv = incrementGlobalClock()  // Advance version
    
    // Validate reads (invisible, no locks held during read phase)
    for each loc in readSet:
        if getVersion(loc) > rv or isLocked(loc):
            releaseLocks(writeSet)
            abortTransaction()
    
    // Apply writes atomically
    for each (loc, val) in writeSet:
        writeValue(loc, val)
        setVersion(loc, wv)
    
    releaseLocks(writeSet)  // Unlock after commit
This example ensures multiple readers proceed concurrently without locking, while writers serialize via ordered, timeout-protected locks.

Language Integration

Proposed Language Extensions

Proposed language extensions for software transactional memory (STM) typically introduce syntactic constructs to delineate transactional code regions, enabling atomic execution without explicit locking. A common proposal is the atomic block, which encapsulates code intended to execute as a transaction, such as atomic { ... } in pseudocode or language-specific variants like atomic(E) { S } where E is an optional expression for early termination conditions. This construct ensures that all operations within the block appear atomic to other threads, with automatic conflict detection and rollback on failure. To handle contention, proposals often include retry clauses, which trigger automatic transaction restarts when dependencies change, as in retry; statements that block until relevant variables are updated by another transaction. These mechanisms simplify concurrent programming by abstracting away manual retry logic, though they require runtime support for validation and speculation. Type system integrations distinguish transactional from non-transactional accesses to enforce at . Transactional references, akin to TVars in functional language proposals, are typed separately from ordinary variables (e.g., TVar a versus a), preventing accidental non-transactional modifications and ensuring that mutable state within transactions is tracked via logs rather than direct writes. This separation leverages the type checker to restrict operations, such as allowing reads/writes only on transactional variables inside blocks, thereby reducing errors and enabling optimizations like barrier . In object-oriented proposals, this extends to transactional fields or objects, where regular references remain unaffected outside transactions to maintain . Standards bodies have explored such extensions for mainstream languages. For , early proposals integrated STM via language-level atomic statements, building on object-based systems to support composable transactions without altering the existing memory model significantly. In C++, the ISO committee's Technical Specification efforts, such as N3718, introduced keywords like transaction_safe for functions and atomic for blocks, alongside attributes for exception propagation, aiming to provide lightweight transactional semantics compatible with existing concurrency primitives. More recent iterations, like P1875R2, refine these to "lite" support emphasizing hardware-assisted transactions while retaining software fallbacks. These proposals prioritize minimal syntax to avoid bloating the language core. Compiler optimizations enhance these extensions by analyzing code to reduce overhead. Escape analysis identifies data that does not escape transaction boundaries, allowing elision of read/write barriers for private or non-shared , which can eliminate up to 90% of in some benchmarks by treating local accesses as non-transactional. This static or dynamic technique integrates with transaction elision, where short or uncontested blocks execute lock-free, improving performance without semantic changes. Challenges in these proposals include ensuring with legacy code and defining precise semantics for . Introducing new keywords risks conflicts with existing identifiers, necessitating reserved namespaces or attributes rather than strict syntax, while library-based implementations avoid parser changes altogether. poses semantic ambiguities: unchecked exceptions may propagate outside transactions, potentially violating atomicity, so proposals specify that only declared exceptions commit the transaction, with others triggering —mirroring checked exceptions in but requiring careful integration with try-catch blocks. These issues have delayed adoption, as extensions must preserve without breaking non-transactional code.

Existing Language Support

Software transactional memory (STM) has been integrated into several programming languages, primarily through libraries or built-in features that leverage the language's concurrency model to provide atomic, consistent, and isolated transactions. In Haskell, STM support is provided via the STM monad in the standard library, introduced in 2005 as part of the Glasgow Haskell Compiler (GHC) version 6.4. This implementation includes primitives such as retry, which aborts and retries a transaction if a transactional variable has changed, and orElse, which allows composing alternative transactions to handle contention non-deterministically. These features enable composable concurrent programming without explicit locking, integrated seamlessly with Haskell's pure functional paradigm. Clojure offers built-in STM support through transactional references (refs) and the dosync macro, available since the language's 1.0 release in October 2008. Refs maintain mutable state across transactions, while dosync delimits code blocks executed atomically, ensuring isolation and consistency for coordinated updates to multiple refs. This design draws from database transaction semantics and is optimized for Clojure's immutable data structures, facilitating safe concurrent modifications in functional-style code. Java lacks native STM in its standard library but supports it through third-party libraries such as TL2, an algorithm implemented for fine-grained transactions, and DeuceSTM, a that instruments without requiring JVM modifications or language extensions. Additionally, experimental JVM extensions like ByteSTM integrate STM at the level by modifying the Jikes RVM to support implicit transactions via rewriting. These approaches allow developers to adopt STM for concurrent data structures while maintaining compatibility with existing codebases. Python provides experimental STM via the PyPy-STM branch, a development effort started around 2011 in the interpreter to enable parallel execution of CPU-bound threads without the , but no longer actively developed as of 2025. This branch implements to manage shared mutable state, allowing multiple threads to run pure code concurrently while handling conflicts through retries and aborts. Although not merged into the main PyPy trunk, it demonstrates STM's potential for scaling Python's concurrency model. Other languages offer limited or experimental STM integrations. In Scala, early versions of the Akka toolkit (up to 2.3) included STM support through transactional references and atomic blocks, enabling actor-based systems to perform coordinated updates, though this feature was deprecated in favor of other concurrency primitives. For C#, experimental STM has been explored in .NET via libraries like SXM, which uses reflection to provide transactional semantics on managed objects, and early prototypes in .NET Framework 4 Beta 1 that allowed keyword-based transaction demarcation. STM implementations must interact with language runtimes, particularly in managing garbage collection () and thread scheduling to ensure transaction correctness and efficiency. GC support often involves techniques like transaction-local allocation buffers to avoid conflicts during collection, allowing objects to be moved without invalidating active transactions. Thread scheduling in STM-aware runtimes typically employs preemptive mechanisms to balance transaction progress, preventing priority inversions by integrating with the runtime's scheduler to retry blocked transactions opportunistically.

Performance Analysis

Evaluation Metrics

Evaluation of software transactional memory (STM) systems relies on a set of standardized metrics to assess both performance and correctness under concurrent execution. Primary performance metrics include throughput, measured as or operations per second, and , defined as the time to complete individual transactions. These metrics are particularly sensitive to contention, where high overlap in accessed memory locations leads to increased aborts and retries. For instance, abort rates— the of transaction rollbacks due to conflicts—serve as a critical indicator of under contention, often exceeding 50% in high-conflict scenarios, which directly impacts overall throughput. Scalability is evaluated through speedup metrics, adapting Amdahl's law to account for contention-induced overheads rather than just sequential fractions. Traditional Amdahl's speedup assumes fixed problem size, but in STM, adaptations incorporate conflict probabilities and retry costs to predict how performance degrades with additional threads; for example, linear speedup is rarely achieved beyond 8-16 cores due to escalating aborts. Correctness measures focus on ensuring serializability, where concurrent transactions appear to execute in some sequential order consistent with their isolation properties. Tools like ChkTM, a model checker for transactional memory, verify serializability by exploring all possible interleavings and checking for anomalies such as write skew, confirming that STM implementations maintain opacity or strict serializability. Standard benchmarks facilitate comparable evaluations across STM implementations. STMBench7, introduced in 2007, simulates complex object-oriented workloads like CAD/CAM applications with 45 operations categorized by traversal length and modification type, measuring throughput and latency across read-dominated (90% reads), balanced, and write-dominated scenarios on multicore systems. Similarly, the vacation benchmark from the STAMP suite (2008) models a travel reservation system with medium-length transactions involving tree traversals for customer queries and updates, emphasizing contention through adjustable client loads that induce varying retry rates (e.g., 0.07 to 0.37 aborts per transaction). Custom workloads are also used to isolate variables, such as graph traversals or linked-list manipulations, to probe specific behaviors. Key factors influencing these metrics include contention level, transaction length, and read/write ratios. High contention, simulated by increasing counts or shared data access, amplifies abort rates and reduces , while longer transactions (e.g., accessing hundreds of objects) heighten probabilities due to larger read/write sets. Read/write ratios further modulate ; read-heavy workloads (e.g., 90% reads) exhibit better with minimal aborts, whereas write-heavy ones (e.g., 90% writes) suffer from frequent s, underscoring the need for contention managers in design. These factors are systematically varied in benchmarks to reveal trade-offs, ensuring evaluations capture realistic multicore dynamics without overhead dominating uncontended cases.

Optimization Approaches

Software transactional memory (STM) systems often employ backoff strategies to manage contention and improve throughput by delaying retry attempts after transaction aborts, thereby reducing wasteful retries in high-conflict scenarios. , a simple priority-based approach, assigns higher priority to transactions that have executed longer, allowing them to proceed while shorter ones yield, which has been shown to enhance in benchmarks like STMBench7. introduces randomized delays that increase geometrically with abort frequency, mitigating livelock in persistent contention; for instance, implementations combining it with priority inheritance achieve up to 2x over fixed-delay retries in synthetic workloads. Karma-based strategies further refine this by accumulating "karma points" for progress made before aborts, favoring transactions with higher karma in resolution decisions, as demonstrated in dynamic contention managers that adapt to workload phases for 15-30% better performance than static policies. Efforts to reduce overhead in focus on minimizing per-object state like locks or version counters, which can double usage in large-scale applications. Time-based techniques, common in protocols like TL2, periodically discard outdated version information using a global clock, limiting metadata growth to O(log n) per object over time and reducing validation by 20-40% in long-running systems. eager-lazy protocols combine eager conflict detection for writes with lazy versioning for reads, avoiding full metadata instrumentation until commit; the Adaptive STM (ASTM) dynamically switches modes based on contention levels, cutting metadata accesses by up to 50% in mixed read-write workloads compared to pure eager designs. Software techniques further optimize STM for specific access patterns, such as for read-mostly data, where shared objects are safely transitioned to after verifying no concurrent access, eliminating transactional overhead for subsequent reads and yielding 3-5x speedups on data structures like queues in low-contention regimes. for short transactions bypasses full logging by using lightweight optimistic checks, committing directly if no conflicts occur; this approach, integrated into libraries like RSTM, reduces abort rates by 25% for microbenchmarks with 1-5 operations, though it requires careful safety guarantees to avoid races. Compiler aids play a crucial role in tuning STM performance by generating efficient code paths. Inlining transactions embeds transactional code directly into callers, eliminating function call overhead and enabling for unused logs, which Intel's research compiler showed improves single-threaded execution by 10-20% in nested scenarios. Partial rollback optimizations allow selective undo of only modified state during aborts, preserving unread portions; implementations supporting this in languages like C++ reduce retry costs by 30-50% in deep nesting, as verified through static analysis of transaction boundaries. A notable example is an algorithmic tweak to the TL2 protocol, which lowers validation cost by incorporating invisible reads that skip write-locking during reads, deferring all checks to commit time; this modification, explored in contention-focused variants, decreases per-read overhead from O(1) metadata touches to near-zero for non-conflicting accesses, boosting throughput by 1.5-2x in read-heavy benchmarks while maintaining opacity.

Practical Applications

Notable Implementations

One of the seminal software transactional memory (STM) implementations is TL2, introduced in 2006 by Dave Dice, Ori Shalev, and Nir Shavit. TL2 employs a approach combining timestamp-based for reads with fine-grained locking during the commit phase to validate and install changes, reducing contention while ensuring . This design has proven influential, particularly in Java-based systems where it inspired subsequent libraries and integrations for scalable concurrent programming. The Rochester (RSTM), developed starting in 2007 at the by L. Scott and colleagues, is an open-source C++ library that provides a flexible framework for experimenting with various STM algorithms. RSTM features modular backends, allowing users to swap conflict detection and resolution mechanisms—such as eager or lazy versioning—while maintaining a consistent based on an extension of the TL2 , which supports both dynamic and static delineation. Its extensibility has made it a staple for academic research in evaluating STM performance and correctness across diverse workloads. libitm serves as the runtime library for transactional memory support in the GNU Compiler Collection (GCC), integrated since GCC 4.7 in 2012. Developed by the GCC team to implement the ISO C++ transactional extensions, libitm offers a pure software fallback mechanism compatible with hardware transactional memory (HTM) instructions, using techniques like timestamp ordering and invisible reads to manage conflicts in multithreaded C and C++ applications. It emphasizes portability across architectures, enabling developers to write lock-free code without platform-specific adaptations. Intel's STM extensions, part of the broader Transactional Synchronization Extensions (TSX) introduced with the Haswell microarchitecture in 2013, include software fallbacks for the Restricted Transactional Memory (RTM) instructions to handle transaction aborts due to conflicts or capacity limits. These fallbacks, implemented via compiler intrinsics in the Intel C++ Compiler, revert to a software-based STM protocol—often leveraging glibc's libitm—ensuring progressive execution while prioritizing hardware acceleration when possible. Although primarily hardware-oriented, the software components provide robust isolation for legacy and mixed-mode applications. In 2024, researchers introduced PIM-STM, a software transactional memory library tailored for processing-in-memory (PIM) systems to mitigate data movement overheads in architectures. This approach leverages PIM's proximity to to reduce in transactional operations, achieving up to 2.5x in conflict-intensive workloads compared to traditional CPU-based implementations. By adapting conflict detection and validation mechanisms to PIM constraints, PIM-STM enables efficient concurrency for memory-bound applications without relying on extensions. A 2025 overview highlighted advancements in thread and optimizations within , emphasizing scheduling to enhance locality and reduce inter-core communication. These techniques use information from executions—such as transaction conflict patterns and shared data access intensity—to dynamically map threads and data structures. Such optimizations address scalability challenges in environments, making more viable for high-throughput parallel programming. Hybrid transactional memory systems have gained traction for analytical workloads, as demonstrated by a 2025 study on graph processing that integrates for transactional updates and GPU high-bandwidth memory for analytics. This model supports low-latency, concurrent operations in AI-driven graph databases, improving throughput by up to 3x in benchmarks like LDBC while maintaining guarantees. Comprehensive 2024 reviews underscore the evolution toward such hardware-software approaches, prioritizing scalability and integration with modern memory hierarchies over pure software solutions. Recent trends reflect a shift toward resilient STM designs for resource-constrained environments, including and workloads, through optimizations like PIM and hybrid models that minimize and use. In , support has improved with the 2025 release of the crate, a high-performance library built on for concurrent data manipulation, facilitating safer parallelism in . These developments signal ongoing efforts to broaden STM's applicability beyond traditional servers to distributed and systems.

References

  1. [1]
    [PDF] Software Transactional Memory - People | MIT CSAIL
    Our paper introduces a non-blocking software version of Herlihy and Moss' transactional memory approach. There are many possible directions in which it can ...
  2. [2]
    [PDF] A Qualitative Survey of Modern Software Transactional Memory ...
    In this paper we present a qualitative survey of modern STM systems that support dynamic transactions. More concretely, we describe the designs of three STM ...
  3. [3]
    [PDF] Transactional Memory: Architectural Support for Lock-Free Data ...
    This paper introducestransactionalmemory, a new mul- tiprocessor architecture intended to make lock-free syn- chronization as efficient (and easy to use) as ...<|control11|><|separator|>
  4. [4]
    Transactional Memory - an overview | ScienceDirect Topics
    Transactional memory (TM) refers to the programming model in which programmers think in terms of transactions instead of locks, allowing them to mark ...
  5. [5]
    [PDF] Software Transactional Memory - MIT
    This paper we will focus on implementations of a transactional memory that supports static. ... In. Proceed- ings of Workshop on. Scalable. Shared. Memory. Multi-.
  6. [6]
    Transactional memory: architectural support for lock-free data ...
    This paper introduces transactional memory, a new multiprocessor architecture intended to make lock-free synchronization as efficient (and easy to use) as ...
  7. [7]
    Software transactional memory - ACM Digital Library
    The performance of spin lock alternatives for shared memory multiprocessors. In IEEE Transaction on Parallel and Distributed Systems, 1(1):6-16, January 1990.
  8. [8]
    [PDF] Language Support for Lightweight Transactions - Research
    They show how the STM can be provided as a library in the Java programming language, with particular method calls used to manage transactions and to 'open' the ...
  9. [9]
    [PDF] Composable Memory Transactions - Simon Marlow
    ; and STM systems to date allow the programmer to guard the atomic block with a boolean condition. (see Section 2.1). None of these mechanisms are composable.Missing: history | Show results with:history
  10. [10]
    Refs and Transactions - Clojure
    The Clojure STM uses multiversion concurrency control with adaptive history queues for snapshot isolation, and provides a distinct commute operation. In ...
  11. [11]
    Transactional Memory - Communications of the ACM
    Jul 1, 2008 · TM offers a mechanism that allows portions of a program to execute in isolation, without regard to other, concurrently executing tasks.
  12. [12]
    On the correctness of transactional memory - ACM Digital Library
    This paper presents opacity, a candidate correctness criterion for TM implementations. We define opacity as a property of concurrent transaction histories.
  13. [13]
    Transactional locking II - ACM Digital Library
    This paper introduces the transactional locking II (TL2) algorithm, a software transactional memory (STM) algorithm based on a combination of commit-time ...
  14. [14]
    Software transactional memory for dynamic-sized data structures
    Abstract. We propose a new form of software transactional memory (STM) designed to support dynamic-sized data structures, and we describe a novel non- ...
  15. [15]
    A comprehensive strategy for contention management in software ...
    In Software Transactional Memory (STM), contention management refers to the mechanisms used to ensure forward progress--to avoid livelock and starvation, ...
  16. [16]
    [PDF] Nested transactional memory: Model and architecture sketches
    The only difference between open and closed nesting in terms of a read/write set execution model concerns what happens when a transaction commits. When an open ...
  17. [17]
    [PDF] Open Nesting in Software Transactional Memory - CS@Purdue
    Mar 17, 2007 · Our goal is to offer open nested transactions as a means for pro- grammers to obtain the precision of locks while retaining the bene- fits of ...Missing: seminal | Show results with:seminal
  18. [18]
    a comparison of locking vs. transactional memory: ACM SIGOPS ...
    Why the grass may not be greener on the other side: a comparison of locking vs. transactional memory · Keep off the grass: locking the right path for atomicity.
  19. [19]
    A study of transactional memory vs. locks in practice
    From lock to correct and efficient software transactional memory. INTERACT-14: Proceedings of the 2010 Workshop on Interaction between Compilers and Computer ...
  20. [20]
    [PDF] Transactional Memory & Programming based on Message Passing
    The difference is the execution! Solution: atomic blocks (or transactions). I want these operations to be performed atomically!
  21. [21]
    A Survey on Parallelism and Determinism - ACM Digital Library
    ... actor model with a First-In-First-Out (FIFO) service policy and futures with ... Software transactional memory has also been combined with actors in ...<|separator|>
  22. [22]
    Erlang ETS tables and software transactional memory
    Erlang ETS tables and software transactional memory: how transactions make ETS tables more like ordinary actors ... actor model runtime environments on multicore ...Missing: comparison | Show results with:comparison
  23. [23]
    [PDF] Resizable, Scalable, Concurrent Hash Tables via Relativistic ...
    In sharp contrast to locking, non-blocking synchroniza- tion, or transactional memory, RCU readers perform no expensive synchronization operations ...
  24. [24]
    [PDF] A Relativistic Enhancement to Software Transactional Memory
    Software Transactional Memory (STM) is a technique that allows programs to take advantage of disjoint access parallelism on both the read-side and write-side. ...
  25. [25]
  26. [26]
    Improving Transactional Memory Performance for Irregular ...
    This work presents ReduxSTM, a software TM system especially designed to extract parallelism from irregular applications. Commit management and conflict ...
  27. [27]
    [PDF] A Comprehensive Strategy for Contention Management in Software ...
    Unfor- tunately, once the access pattern becomes irregular (for example, when transactions can start at either end of a doubly linked list), eager STM is prone ...
  28. [28]
    Low-overhead software transactional memory with progress ...
    Software transactional memory offers an appealing alternative to locks by improving programmability, reliability, and scalability.
  29. [29]
    [PDF] Transactional Memory - Computer Science (CS)
    This book presents an overview of the state of the art in the design and implementation of transactional memory systems, as of early spring 2010. KEYWORDS.
  30. [30]
    [PDF] Lowering the Overhead of Nonblocking Software Transactional ...
    In this paper we presented RSTM, a new, low-overhead software transactional memory for C++. In comparison to previous nonblocking STM systems, RSTM. 1. uses ...Missing: seminal slowdown
  31. [31]
    Software Transactional Memory: Why Is It Only a Research Toy?
    Oct 24, 2008 · For end users, the advantage of an STM is that it offers an environment to transactionalize (that is, porting to TM) their applications without ...
  32. [32]
    [PDF] Understanding Tradeoffs in Software Transactional Memory
    Our paper reexamines the design decisions behind these state-of-the-art STM algorithms. Building on the body of prior art together with our new understanding of ...
  33. [33]
    [PDF] Unrestricted Transactional Memory: Supporting I/O and System ...
    May 9, 2006 · cessor (a 4x slowdown, not shown), because when no threads are ... Software transactional memory for dynamic-sized data struc- tures.<|separator|>
  34. [34]
    [PDF] Transactional Memory Today1 1 Motivation
    Jun 19, 2015 · In 1997, Shavit and Touitou coined the term “Software Transactional. Memory,” in a paper that shared with H&M the 2012 Dijkstra Prize [33]. And ...
  35. [35]
    [PDF] A Flexible Framework for Implementing Software Transactional ...
    [12] Maurice Herlihy and J. Eliot B. Moss. Transactional memory: Architectural support for lock-free data structures. In Proc. 20th Annual International.
  36. [36]
    [PDF] Conflict Detection and Validation Strategies for Software ...
    Abstract. In a software transactional memory (STM) system, conflict detection is the problem of determining when two transactions cannot both safely commit.
  37. [37]
    [PDF] Contention Management in Dynamic Software Transactional Memory
    In DSTM, contention management decides which transaction to abort when multiple transactions access the same block, and it must ensure progress out-of-band.
  38. [38]
    [PDF] Transactional Locking II - People | MIT CSAIL
    This paper introduces the transactional locking II (TL2) algorithm, a software transactional memory (STM) algorithm based on a combination of commit-time ...
  39. [39]
    [PDF] Towards a Fully Pessimistic STM Model - TRANSACT 2012
    Feb 11, 2012 · This paper introduces the first STM system that is fully pes- simistic, that is, each and every transaction, whether reading or writing, is ...
  40. [40]
    Hybrid transactional memory - ACM Digital Library
    We introduce Hybrid Transactional Memory (HyTM), an approach to implementing TMin software so that it can use best effort hardware TM (HTM) to boost performance ...
  41. [41]
    [PDF] Refined Transactional Lock Elision
    Transactional Lock Elision (TLE) is a well-known technique that exploits hardware transactional memory (HTM) to introduce con- currency into lock-based software ...
  42. [42]
    [PDF] TLRW: Return of the Read-Write Lock - TRANSACT 2009
    Feb 7, 2009 · TL2 and similar STM algorithms deliver high scalability based on write-locking and invisible readers. In fact, no modern STM design locks to ...
  43. [43]
    [PDF] Dreadlocks: Efficient Deadlock Detection - Eric Koskinen
    Jun 16, 2008 · Interestingly, TL2 could have avoided deadlocks by sorting the addresses of memory locations to be locked, but the cost of sorting those ...
  44. [44]
    [PDF] Compiler and Runtime Support for Efficient Software Transactional ...
    Jun 16, 2006 · In this section, we demonstrate that transactional Java programs run- ning on our STM are competitive with synchronized Java programs,.
  45. [45]
    [PDF] A Compositional Theory for STM Haskell - Microsoft
    The syntax of lambda calculus expressions provides a compositional and uniform formalism for both source programs and their run-time states.
  46. [46]
    [PDF] 22-monads-stm.pdf - cs.Princeton
    Haskell type system ensures TVars can only be modified in transactions. ... There are similar proposals for adding STM to. Java and other mainstream languages.
  47. [47]
    [PDF] Transactional Memory Support for C++ - Open Standards
    Aug 30, 2013 · This document describes a proposal developed by SG5 to introduce transactional constructs into C++ as a Technical Specification. It is based in ...Missing: N3797 | Show results with:N3797
  48. [48]
    [PDF] Transactional Memory Lite Support in C++ - Open Standards
    Mar 14, 2021 · The execution of code within an atomic block is called a transaction. Transactions are guaranteed to appear atomic with respect to other ...
  49. [49]
    [PDF] Enforcing Isolation and Ordering in STM - University of Washington
    We demonstrate how to implement non- transactional data accesses via efficient read and write barriers, and we present compiler optimizations that further ...
  50. [50]
    [PDF] Exceptions and Transactions in C++ - USENIX
    The proposal outlined in this paper enables program- mers to explicitly indicate which types of exception may escape the atomic block and commit it; if an ...
  51. [51]
    [PDF] Design choices for language-based transactions
    In practise exception propagation is complicated by the fact that the translated code should retain the expected throws clause. Native transaction management.
  52. [52]
    [PDF] Noninvasive concurrency with Java STM - People | MIT CSAIL
    Deuce provides several benefits over existing Java STM frameworks: it avoids any changes or additions to the JVM, it does not require language extensions or ...
  53. [53]
    [PDF] ByteSTM: Virtual Machine-level Java Software Transactional Memory
    ByteSTM implements two STM algorithms,. TL2 and RingSTM, and transparently supports implicit transactions. Program bytecode is automatically modified to support ...
  54. [54]
    Software Transactional Memory - PyPy documentation
    This page is about pypy-stm, a special in-development version of PyPy which can run multiple independent CPU-hungry threads in the same process in parallel.
  55. [55]
    We need Software Transactional Memory - PyPy
    Aug 23, 2011 · A short summary paper about my current position on Software Transactional Memory as a general tool in the implementation of Python or Python-like languages.Missing: survey | Show results with:survey<|control11|><|separator|>
  56. [56]
    Software Transactional Memory (Scala) - Akka Documentation
    An STM turns the Java heap into a transactional data set with begin/commit/rollback semantics. Very much like a regular database.Missing: integration | Show results with:integration
  57. [57]
    SXM: C# Software Transactional Memory - Microsoft
    The SXM is a software transactional memory package written in C#. It is much easier to use than prior STMs because it uses Reflection.<|separator|>
  58. [58]
    [PDF] The Transactional Memory / Garbage Collection Analogy
    Preemptive scheduling means a thread can be stopped at any point so other threads can use one of the available processors.
  59. [59]
    [PDF] Performance Evaluation of Adaptivity in Software Transactional ...
    We position local adaptivity as an extension to existing systems. Using the STAMP benchmarks, we compare adaptSTM to two other STM libraries, TL2 and tinySTM.
  60. [60]
    [PDF] Understanding Transactional Memory Performance
    In order to help programmers assess the suitability of their code for transactional memory, this paper introduces a formal model of transactional memory as well ...
  61. [61]
    [PDF] Implementing and Evaluating a Model Checker for Transactional ...
    We will discuss how. ChkTM verifies the serializability of every possible execution of TM programs in Section IV-A. Strong isolation: A TM system provides ...
  62. [62]
    [PDF] STMBench7: A Benchmark for Software Transactional Memory
    A collection of operations is supported to model a wide range of workloads and concurrency patterns. Companion locking strategies serve as a baseline for STM.
  63. [63]
    [PDF] STAMP: Stanford Transactional Applications for Multi-Processing
    Over 80% of the execution time is spent in transactions by five of the eight applications: bayes, genome, labyrinth, vacation, and yada. These applications use ...
  64. [64]
    [PDF] Toward a Theory of Transactional Contention Managers
    The literature includes a number of contention manager proposals [10, 23], ranging from simple (exponential back- off) to elaborate (various priority-based ...
  65. [65]
    [PDF] Dynamic Performance Tuning of Word-Based Software ... - UniNE
    Feb 23, 2008 · In this paper, we investigate dynamic tuning mechanisms on a new time-based software transactional memory implementation. We study in ...
  66. [66]
    [PDF] Adaptive Software Transactional Memory*
    Transactions acquire objects when first accessed under eager acquire semantics, but at commit time under lazy acquire semantics. Eager acquire allows a ...
  67. [67]
    [PDF] Privatization Techniques for Software Transactional Memory
    Transactional memory (TM) allows the programmer to encapsulate arbitrary memory operations into a transaction, which is then guaranteed to be atomic (all of its ...
  68. [68]
    [PDF] Transparent Support for Partial Rollback in Software Transactional ...
    The Software Transactional Memory (STM) paradigm has gained momentum thanks to its ability to provide synchronization trans- parency in concurrent applications.
  69. [69]
    (PDF) Transactional Locking II - ResearchGate
    Aug 7, 2025 · This paper introduces the transactional locking II (TL2) algorithm, a software transactional memory (STM) algorithm based on a combination of commit-time ...
  70. [70]
    Rochester Software Transactional Memory
    Jul 6, 2010 · RSTM is a C++ package that now contains thirteen different STM library implementations, and a smart-pointer based API that allows consistent, ...
  71. [71]
    Top (GNU libitm)
    This manual documents the usage and internals of libitm, the GNU Transactional Memory Library. It provides transaction support for accesses to a process' memory ...
  72. [72]
    Transactional Memory in GCC
    Feb 6, 2012 · In general, implementations come in two forms: a Software Transactional Memory (STM) system uses locks or other standard atomic instructions to ...
  73. [73]
    A compositional method for verifying software transactional memory ...
    Apr 1, 2008 · We present a compositional method for verifying software transactional memory (STM) implementations and its application to the Bartok STM.Missing: notable TL2 GCC Intel Oracle JRockit
  74. [74]
    PIM-STM: Software Transactional Memory for Processing-In-Memory ...
    Apr 27, 2024 · This work tackles the problem of how to build efficient software implementations of the Transactional Memory (TM) abstraction by introducing PIM-STM.Missing: advantages challenges
  75. [75]
    Hybrid Transactional/Analytical Graph Processing in Modern ...
    Jan 24, 2025 · In this paper, we present results of our project on exploiting modern memory hierarchies in support of hybrid transactional/analytical processing (HTAP) on ...
  76. [76]
    Software Transactional Memory: A Comprehensive Review of ...
    Jun 12, 2024 · This paper provides a comprehensive review of Software Transactional Memory (STM) systems, emphasizing their evolution, design, challenges, and applications.
  77. [77]
    khonsu - crates.io: Rust Package Registry
    May 13, 2025 · A high-performance Software Transactional Memory (STM) library for Rust, designed for concurrent data access and manipulation using Arrow ...