Transactional memory (TM) is a feature that was proposed some time ago in academia, but only recently has been implemented in modern, mainstream processors.
TM is intended to simplify parallel programming, as an alternative to using locks. For example:
- Coarse-grained locking is fairly easy to program, but might not have good scalability
- Fine-grained locking is hard to program, but generally has good scalability
TM is intended to offer the simplicity of course-grained locking, and the performance of fine-grained locking.
IBM® POWER8™, the newest IBM Power Systems™ processor, has an implementation of TM, including unique features, such as suspending and resuming transactional execution. POWER8 supports IBM AIX®, IBM i, and Linux.
Historically, lock acquisition and release has been used to protect shared data that is being read or written by multiple threads. This guarantees that the data is isolated, preventing concurrent reads/manipulation/stores. With TM, the processor no longer needs to use locking. Rather, it uses a different mechanism ...
Transactional lock elision (TLE) uses TM to skip (or elide) the acquisition and release of mutual exclusion locks (locks that prevent concurrent use of data during critical sections of code) and other types of locks, when possible. Results are:
- When successful, TLE enables higher concurrency, as it allows multiple non-conflicting critical sections of code that are protected by the same lock to execute concurrently. In contrast, lock acquisition and release serializes the execution of such critical sections.
- Successful TLE can also reduce cache coherence traffic, as the lock variables are only read (but not written) under TLE, in contrast to being written when the locks are acquired and released.
On the flip side, a disadvantage of applying TLE indiscriminately is that computing cycles may be wasted on failed TLE transactions. Adaptive TLE techniques can be used to selectively avoid using TLE when TLE transactions are likely to fail.
Other benefits of TM include:
- Using TM allows applications that have not been carefully tuned for performance to take advantage of the benefits of fine-grained locking.
- The transactional programming model provides productivity gains when developing shared memory programs.
- Applications can use TM to checkpoint and restore architectural state, independent of the atomic storage access guarantees that are provided by TM.
For information about IBM Power Systems and the POWER8 processor, visit:
This blog accompanies IBM Redbooks® publications that describe techniques for optimizing IBM POWER8 (and earlier) environments. Download these resources and provide feedback:
Employing Strategies for Optimizing your IBM POWER8 (and Earlier) Processor-based Systems
http://www.redbooks.ibm.com/abstracts/tips1153.html (a summarized version of the following book)
Performance Optimization and Tuning Techniques for IBM Processors, including IBM POWER8
The IBM POWER8 processor: The hype is worth a look (blog)
Is your processor functioning at it’s potential? (blog)
The IBM POWER8 processor and IBM Power Systems (video)