Transactional Memory (TM) simplifies parallel programming by supporting atomic and isolated execution of useridentified tasks. To date, TM programming requires the use of libraries that make it difficult to achieve scalable performance with code that is easy to develop and maintain. For TM programming to become practical, it is important to integrate TM into familiar, high-level environments for parallel programming.
This paper presents OpenTM, an application programming interface (API) for parallel programming with transactions. OpenTM extends OpenMP, a widely used API for shared-memory parallel programming, with a set of compiler directives to express non-blocking synchronization and speculative parallelization based on memory transactions. We also present a first OpenTM implementation, which consists of a source-to-source translator and a runtime environment for the C programming language. We evaluate the performance and programmability features of OpenTM. We show that it delivers the performance of fine-grain locks at the programming complexity of fine-grain locks. Compared to transactional programming with lower-level APIs, it removes the burden of parallel code and data management and enables easy changes of the scheduling and contention management policies. Overall, OpenTM provides a practical and efficient TM programming environment within the familiar scope of OpenMP.