On Correctness of Data Structures under Reads-Write Concurrency

We study the correctness of shared data structures under reads-write concurrency. A popular approach to ensuring correctness of read-only operations in the presence of concurrent update, is read-set validation, which checks that all read variables have not changed since they were first read. In practice, this approach is often too conservative, which adversely affects performance. In this paper, we introduce a new framework for reasoning about correctness of data structures under reads-write concurrency, which replaces validation of the entire read-set with more general criteria. Namely, instead of verifying that all read shared variables still hold the values read from them, we verify abstract conditions over the shared variables, which we call base conditions. We show that reading values that satisfy some base condition at every point in time implies correctness of read-only operations executing in parallel with updates. Somewhat surprisingly, the resulting correctness guarantee is not equivalent to linearizability, and is instead captured through two new conditions: validity and regularity. Roughly speaking, the former requires that a read-only operation never reaches a state unreachable in a sequential execution; the latter generalizes Lamport’s notion of regularity for arbitrary data structures, and is weaker than linearizability. We further extend our framework to capture also linearizability. We illustrate how our framework can be applied for reasoning about correctness of a variety of implementations of data structures such as linked lists.

[1]  Maurice Herlihy,et al.  Proving correctness of highly-concurrent linearisable objects , 2006, PPoPP '06.

[2]  Leslie Lamport,et al.  How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs , 2016, IEEE Transactions on Computers.

[3]  Michael Stonebraker,et al.  Readings in database systems (3rd ed.) , 1998 .

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

[5]  EE KfirLev-Ari On Correctness of Data Structures under Reads-Write Concurrency ∗ , 2015 .

[6]  Behrokh Samadi,et al.  B-Trees in a System with Multiple Users , 1976, Inf. Process. Lett..

[7]  Paul E. McKenney,et al.  Using Read-Copy-Update Techniques for System V IPC in the Linux 2.5 Kernel , 2003, USENIX Annual Technical Conference, FREENIX Track.

[8]  William N. Scherer,et al.  Advanced contention management for dynamic software transactional memory , 2005, PODC '05.

[9]  Nir Shavit,et al.  Pessimistic Software Lock-Elision , 2012, DISC.

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

[11]  David Lorge Parnas,et al.  Concurrent control with “readers” and “writers” , 1971, CACM.

[12]  Hagit Attiya,et al.  Concurrent updates with RCU: search tree as an example , 2014, PODC '14.

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

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

[15]  Adrian Colbrook,et al.  Concurrent Data Structures , 1991, ICCI.

[16]  Mark Moir,et al.  Concurrent Data Structures , 2004 .

[17]  William G. Griswold,et al.  Dynamically discovering likely program invariants to support program evolution , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[18]  Nancy A. Lynch,et al.  Proving Atomicity: An Assertional Approach , 2005, DISC.

[19]  Paul E. McKenney,et al.  Selecting locking primitives for parallel programming , 1996, CACM.

[20]  Jennifer L. Welch,et al.  Multiwriter Consistency Conditions for Shared Memory Registers , 2011, SIAM J. Comput..

[21]  Paul E. McKenney,et al.  READ-COPY UPDATE: USING EXECUTION HISTORY TO SOLVE CONCURRENCY PROBLEMS , 2002 .

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

[23]  Leslie Lamport,et al.  On interprocess communication , 1986, Distributed Computing.

[24]  Jim Gray,et al.  A critique of ANSI SQL isolation levels , 1995, SIGMOD '95.

[25]  Leslie Lamport,et al.  On Interprocess Communication-Part I: Basic Formalism, Part II: Algorithms , 2016 .

[26]  Rudolf Bayer,et al.  Concurrency of operations on B-trees , 1994, Acta Informatica.

[27]  Faith Ellen,et al.  Pragmatic primitives for non-blocking data structures , 2013, PODC '13.

[28]  Nir Shavit,et al.  Flat combining and the synchronization-parallelism tradeoff , 2010, SPAA '10.

[29]  Michael J. Franklin,et al.  Concurrency Control and Recovery , 2014, Encyclopedia of Database Systems.