Lock-Free Transactional Transformation for Linked Data Structures

Nonblocking data structures allow scalable and thread-safe access to shared data. They provide individual operations that appear to execute atomically. However, it is often desirable to execute multiple operations atomically in a transactional manner. Previous solutions, such as Software Transactional Memory (STM) and transactional boosting, manage transaction synchronization separately from the underlying data structure’s thread synchronization. Although this reduces programming effort, it leads to overhead associated with additional synchronization and the need to rollback aborted transactions. In this work, we present a new methodology for transforming high-performance lock-free linked data structures into high-performance lock-free transactional linked data structures without revamping the data structures’ original synchronization design. Our approach leverages the semantic knowledge of the data structure to eliminate the overhead of false conflicts and rollbacks. We encapsulate all operations, operands, and transaction status in a transaction descriptor, which is shared among the nodes accessed by the same transaction. We coordinate threads to help finish the remaining operations of delayed transactions based on their transaction descriptors. When a transaction fails, we recover the correct abstract state by reversely interpreting the logical status of a node. We also present an obstruction-free version of our algorithm that can be applied to dynamic execution scenarios and an example of our approach applied to a hash map. In our experimental evaluation using transactions with randomly generated operations, our lock-free transactional data structures outperform the transactional boosted ones by 70% on average. They also outperform the alternative STM-based approaches by a factor of 2 to 13 across all scenarios. More importantly, we achieve 4,700 to 915,000 times fewer spurious aborts than the alternatives.

[1]  Eran Yahav,et al.  Testing atomicity of composed concurrent operations , 2011, OOPSLA '11.

[2]  Bengt Jonsson,et al.  A Skiplist-Based Concurrent Priority Queue with Minimal Memory Contention , 2013, OPODIS.

[3]  Timothy L. Harris,et al.  A Pragmatic Implementation of Non-blocking Linked-Lists , 2001, DISC.

[4]  Eran Yahav,et al.  Automatic scalable atomicity via semantic locking , 2015, PPoPP.

[5]  David Eisenstat,et al.  Lowering the Overhead of Nonblocking Software Transactional Memory , 2006 .

[6]  Roberto Palmieri,et al.  On Developing Optimistic Transactional Lazy Set , 2014, OPODIS.

[7]  Maurice Herlihy,et al.  Transactional boosting: a methodology for highly-concurrent transactional objects , 2008, PPoPP.

[8]  Maurice Herlihy,et al.  Coarse-grained transactions , 2010, POPL '10.

[9]  Rachid Guerraoui,et al.  On obstruction-free transactions , 2008, SPAA '08.

[10]  Pierre LaBorde,et al.  A Wait-Free Hash Map , 2017, International Journal of Parallel Programming.

[11]  David Gay,et al.  Autolocker: synchronization inference for atomic sections , 2006, POPL '06.

[12]  Maurice Herlihy,et al.  Linearizability: a correctness condition for concurrent objects , 1990, TOPL.

[13]  Sumit Gulwani,et al.  Inferring locks for atomic sections , 2008, PLDI '08.

[14]  Håkan Grahn,et al.  Transactional memory , 2010, J. Parallel Distributed Comput..

[15]  Virendra J. Marathe,et al.  Design tradeoffs in modern software transactional memory systems , 2004 .

[16]  Emmett Witchel,et al.  Is transactional programming actually easier? , 2010, PPoPP '10.

[17]  Maurice Herlihy,et al.  Transactional Memory: Architectural Support For Lock-free Data Structures , 1993, Proceedings of the 20th Annual International Symposium on Computer Architecture.

[18]  Maurice Herlihy,et al.  The Art of Multiprocessor Programming, Revised Reprint , 2012 .

[19]  Nir Shavit,et al.  Scalable concurrent priority queue algorithms , 1999, PODC '99.

[20]  Rachid Guerraoui,et al.  Composing Relaxed Transactions , 2013, 2013 IEEE 27th International Symposium on Parallel and Distributed Processing.

[21]  Faith Ellen,et al.  Non-blocking binary search trees , 2010, PODC.

[22]  Bratin Saha,et al.  McRT-STM: a high performance software transactional memory system for a multi-core runtime , 2006, PPoPP '06.

[23]  Deli Zhang,et al.  A Lock-Free Priority Queue Design Based on Multi-Dimensional Linked Lists , 2016, IEEE Transactions on Parallel and Distributed Systems.

[24]  Eran Yahav,et al.  Concurrent libraries with foresight , 2013, PLDI.

[25]  Keir Fraser,et al.  Practical lock-freedom , 2003 .

[26]  Maged M. Michael,et al.  High performance dynamic lock-free hash tables and list-based sets , 2002, SPAA '02.

[27]  Hagit Attiya The inherent complexity of transactional memory and what to do about it , 2010, PODC '10.

[28]  Mark Moir,et al.  Early experience with a commercial hardware transactional memory implementation , 2009, ASPLOS.

[29]  Rachid Guerraoui,et al.  On the correctness of transactional memory , 2008, PPoPP.

[30]  Christos H. Papadimitriou,et al.  The serializability of concurrent database updates , 1979, JACM.

[31]  Nir Shavit,et al.  Transactional Locking II , 2006, DISC.

[32]  Idit Keidar,et al.  Transactional data structure libraries , 2016, PLDI.

[33]  Bratin Saha,et al.  Open nesting in software transactional memory , 2007, PPOPP.

[34]  Minjia Zhang,et al.  Low-overhead software transactional memory with progress guarantees and strong semantics , 2015, PPOPP.

[35]  Rupak Majumdar,et al.  Lock allocation , 2007, POPL '07.

[36]  Michael F. Spear,et al.  NOrec: streamlining STM by abolishing ownership records , 2010, PPoPP '10.

[37]  Kunle Olukotun,et al.  Transactional predication: high-performance concurrent sets and maps for STM , 2010, PODC '10.

[38]  Timothy L. Harris,et al.  Lock Inference in the Presence of Large Libraries , 2012, ECOOP.

[39]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[40]  Roberto Palmieri,et al.  Integrating Transactionally Boosted Data Structures with STM Frameworks: A Case Study on Set , 2014 .

[41]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.