Are lock-free concurrent algorithms practically wait-free?

Lock-free concurrent algorithms guarantee that some concurrent operation will always make progress in a finite number of steps. Yet programmers prefer to treat concurrent code as if it were wait-free, guaranteeing that all operations always make progress. Unfortunately, designing wait-free algorithms is generally a very complex task, and the resulting algorithms are not always efficient. While obtaining efficient wait-free algorithms has been a long-time goal for the theory community, most non-blocking commercial code is only lock-free. This paper suggests a simple solution to this problem. We show that, for a large class of lock-free algorithms, under scheduling conditions which approximate those found in commercial hardware architectures, lock-free algorithms behave as if they are wait-free. In other words, programmers can keep on designing simple lock-free algorithms instead of complex wait-free ones, and in practice, they will get wait-free progress. Our main contribution is a new way of analyzing a general class of lock-free algorithms under a stochastic scheduler. Our analysis relates the individual performance of processes with the global performance of the system using Markov chain lifting between a complex per-process chain and a simpler system progress chain. We show that lock-free algorithms are not only wait-free with probability 1, but that in fact a general subset of lock-free algorithms can be closely bounded in terms of the average number of steps required until an operation completes. To the best of our knowledge, this is the first attempt to analyze progress conditions, typically stated in relation to a worst case adversary, in a stochastic model capturing their expected asymptotic behavior.

[1]  Leslie Lamport,et al.  A new solution of Dijkstra's concurrent programming problem , 1974, Commun. ACM.

[2]  Dan Alistarh,et al.  Lease/release: architectural support for scaling contended data structures , 2016, PPOPP.

[3]  Garth A. Gibson,et al.  Implementing Lottery Scheduling: Matching the Specializations in Traditional Schedulers , 1999, USENIX Annual Technical Conference, General Track.

[4]  Samy Al Bahra,et al.  Nonblocking algorithms and scalable multicore programming , 2013, CACM.

[5]  Harald Niederreiter,et al.  Probability and computing: randomized algorithms and probabilistic analysis , 2006, Math. Comput..

[6]  Donald E. Knuth,et al.  The art of computer programming, volume 3: (2nd ed.) sorting and searching , 1998 .

[7]  Maged M. Michael,et al.  Simple, fast, and practical non-blocking and blocking concurrent queue algorithms , 1996, PODC '96.

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

[9]  Thomas Sauerwald,et al.  Lock-Free Algorithms under Stochastic Schedulers , 2015, PODC.

[10]  Paul Renaud-Goud,et al.  Analyzing the Performance of Lock-Free Data Structures: A Conflict-based Model , 2015, DISC.

[11]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[12]  PetrankErez,et al.  A methodology for creating fast wait-free data structures , 2012 .

[13]  V. Climenhaga Markov chains and mixing times , 2013 .

[14]  Erez Petrank,et al.  A methodology for creating fast wait-free data structures , 2012, PPoPP '12.

[15]  G. Lipari On the nature of progress , 2011 .

[16]  Mark Moir,et al.  Scalable statistics counters , 2013, PPoPP '13.

[17]  Samy Al-Bahra Nonblocking algorithms and scalable multicore programming , 2013, CACM.

[18]  Eli Upfal,et al.  Probability and Computing: Randomized Algorithms and Probabilistic Analysis , 2005 .

[19]  G. S. Graham A New Solution of Dijkstra ' s Concurrent Programming Problem , 2022 .

[20]  Donald E. Knuth,et al.  Additional comments on a problem in concurrent programming control , 1966, CACM.

[21]  James Aspnes,et al.  Fast deterministic consensus in a noisy environment , 2000, PODC '00.

[22]  Thomas P. Hayes,et al.  Liftings of Tree-Structured Markov Chains - (Extended Abstract) , 2010, APPROX-RANDOM.

[23]  Maurice Herlihy,et al.  The art of multiprocessor programming , 2020, PODC '06.

[24]  Mark Moir,et al.  Obstruction-Free Algorithms Can Be Practically Wait-Free , 2005, DISC.

[25]  W. Marsden I and J , 2012 .

[26]  Fang Chen,et al.  Lifting Markov chains to speed up mixing , 1999, STOC '99.

[27]  Erez Petrank,et al.  A practical wait-free simulation for lock-free data structures , 2014, PPoPP '14.

[28]  Maurice Herlihy,et al.  Obstruction-free synchronization: double-ended queues as an example , 2003, 23rd International Conference on Distributed Computing Systems, 2003. Proceedings..

[29]  Maurice Herlihy,et al.  Wait-free synchronization , 1991, TOPL.

[30]  Jonathan Walpole,et al.  The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with Linux , 2008, IBM Syst. J..