Transactional memory with strong atomicity using off-the-shelf memory protection hardware
Authors:
Open Access
- 14 February 2009
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 44 (4) , 185-196
Abstract
This paper introduces a new way to provide strong atomicity in an implementation of transactional memory. Strong atomicity lets us offer clear semantics to programs, even if they access the same locations inside and outside transactions. It also avoids differences between hardware-implemented transactions and software-implemented ones. Our approach is to use off-the-shelf page-level memory protection hardware to detect conflicts between normal memory accesses and transactional ones. This page-level mechanism ensures correctness but gives poor performance because of the costs of manipulating memory protection settings and receiving notifications of access violations. However, in practice, we show how a combination of careful object placement and dynamic code update allows us to eliminate almost all of the protection changes. Existing implementations of strong atomicity in software rely on detecting conflicts by conservatively treating some non-transactional accesses as short transactions. In contrast, our page-level mechanism lets us be less conservative about how non-transactional accesses are treated; we avoid changes to non-transactional code until a possible conflict is detected dynamically, and we can respond to phase changes where a given instruction sometimes generates conflicts and sometimes does not. We evaluate our implementation with C# versions of many of the STAMP benchmarks, and show how it performs within 25% of an implementation with weak atomicity on all the benchmarks we have studied. It avoids pathological cases in which other implementations of strong atomicity perform poorly.Keywords
This publication has 22 references indexed in Scilit:
- Software transactional memoryCommunications of the ACM, 2008
- A Model of Dynamic Separation for Transactional MemoryLecture Notes in Computer Science, 2008
- Enforcing isolation and ordering in STM2007
- Unbounded page-based transactional memory2006
- Optimizing memory transactions2006
- Transactional Locking II2006
- Language support for lightweight transactions2003
- Efficient on-the-fly data race detection in multithreaded C++ programs2003
- Points-to analysis in almost linear time1996
- Transactional memory1993