Implicit Privatization Using Private Transactions
Dave Dice, Alexander Matveev, Nir Shavit · 2010
In software transactional memory (STM) systems, it is useful to isolate a memory region accessed by one thread from all others, so that it can then operate on it “privately”, that is, without the instrumentation overhead of inter-transactional synchronization. Allowing transactions to implicitly privatize memory is a source of major performance degradation in state-of-the-art STMs. The alternative, to explicitly declare and guarantee privacy only when needed, has been argued to be too tricky to be useful for general programming. This paper proposes private transactions, a simple intermediate that combines the ease of use of implicit privatization, with the efficiency that can be obtained from explicitly knowing which regions are private. We present a new scalable quiescing algorithm for implicit privatization using private transactions, applicable to virtually any STM algorithm, including the best performing TL2/LSA-style STMs. The new algorithm delivers virtually unhindered performance at all privatization levels when private transactions involve work, and even under the extreme case of empty private transactions, allows for a scalable “pay as you go ” privatization overhead depending on the privatization level. 1.