From lock to correct and efficient software transactional memory

  • Authors:
  • Cheng Wang;Youfeng Wu

  • Affiliations:
  • Intel Labs, Santa Clara, CA;Intel Labs, Santa Clara, CA

  • Venue:
  • Proceedings of the 2010 Workshop on Interaction between Compilers and Computer Architecture
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Transactional memory solves many problems in lock-based parallel programs. Unfortunately, the semantics of transactions are different from those of critical sections defined by locks. The semantic differences make it difficult to correctly port existing lock-based programs to transaction-based programs. Experienced programmers accustomed to lock-based programming can easily make mistakes in transaction-based programming as parallel programs running correctly using locks can run incorrectly when converted to using transactions. This problem becomes even more severe in the efficient software transactional memory implementing weak isolation, optimistic read concurrency management and eager version management. In this paper, we first identify three necessary properties in a program for the program execution using transactions to be equivalent to the program execution using locks. Assuming that the input lock-based program satisfies the necessary properties (i.e. well-behaved parallel programs), we next present a correctness condition for the program execution using transactions to be equivalent to the program execution using locks. Finally, we develop a correct and efficient software transactional memory implementation that satisfies the correctness condition so that locks in the well behaved parallel programs can be converted to use efficient software transactional memory easily and correctly.