A Study of Hybrid Transactional Memory
Fuad Tabba · ResearchSpace (University of Auckland) · 2011
The rise of multicore processors is driving programmers towards parallel programming. Traditional lock-based parallel programming, however, breaks abstraction, hinders composition, and is further complicated by issues such as deadlock, priority inversion, and lack of scalability. Transactional memory, a promising programming model inspired by database transactions, is gaining popularity as a way to overcome the drawbacks of lock-based programming and make it easier to write parallel programs. Different methods have been proposed for supporting transactional memory. Hardware proposals, which modify a processor's existing hardware to support transactions, are either too complex, or cannot handle all types of workload. Software proposals, which do not require any hardware support beyond what is already present for parallel programming, are too slow. This thesis argues that transactional memory should be supported by a hybrid combination of hardware and software. By combining the two, transactional memory can offer the best of both hardware and software. To support this argument, this thesis presents my work on transactional memory, which spans the areas of hardware, software, and hybrid support. This thesis presents NZSTM, the first nonblocking, object-based, software transactional memory that does not require indirection to access data in the common case. It also presents NZTM, a hybrid transactional memory that uses NZSTM as its software component. The evaluation presented shows that nonblocking support introduces little overhead compared with blocking algorithms, and that NZTM is competitive with pure hardware transactional memory. Furthermore, this thesis investigates how to improve the performance of hardware transactional memory by using data speculation in transactions, and how to reduce transactional conflicts by decoupling them from cache coherence conflicts. Most hardware proposals do not distinguish between transactional conflicts and coherence conflicts, leading to false transactional conflicts. This thesis explains how to mitigate the effects of coherence conflicts by using value prediction in transactions. It also shows that coherence decoupling and value prediction in transactions complement each other, because they both speculate on data in ways that are infeasible in the absence of hardware transactional memory support.