Static Analysis of Atomicity for Programs with Lock-Free Synchronization

In concurrent programming, lock-free synchronization is very ecien t but dicult to design correctly. This paper presents a static analysis to show that code blocks are atomic, i.e., that every execution of the program is equivalent to one in which those code blocks execute without interruption by other threads. Our analysis determines commutativity of operations based primarily on how synchronization primitives (including locks, load-linked, store-conditional, and compare-and-swap) are used. A reduction theorem states that certain patterns of commutativity imply atomicity. Atomicity is itself an important correctness requirement for many concurrent programs. Furthermore, an atomic code block can be treated as a single transition during subsequent analysis of the program; this can greatly improve the eciency of the subsequent analysis. We demonstrate the eectiv eness of our approach on several concurrent lock-free programs.

[1]  Maged M. Michael Scalable lock-free dynamic memory allocation , 2004, PLDI '04.

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

[3]  Doron A. Peled,et al.  Ten Years of Partial Order Reduction , 1998, CAV.

[4]  Richard J. Lipton,et al.  Reduction: a method of proving properties of parallel programs , 1975, CACM.

[5]  Richard S. Varga,et al.  Proof of Theorem 5 , 1983 .

[6]  Maurice Herlihy,et al.  A methodology for implementing highly concurrent data objects , 1993, TOPL.

[7]  Hui Gao,et al.  A Formal Reduction for Lock-Free Parallel Algorithms , 2004, CAV.

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

[9]  Eran Yahav,et al.  Automatically Verifying Concurrent Queue Algorithms , 2003, SoftMC@CAV.

[10]  Cormac Flanagan,et al.  Types for atomicity , 2003, TLDI '03.

[11]  Scott D. Stoller,et al.  Run-Time Analysis for Atomicity , 2003, Electron. Notes Theor. Comput. Sci..

[12]  Jakob Rehof,et al.  Summarizing procedures in concurrent programs , 2004, POPL.

[13]  Gerard J. Holzmann,et al.  The SPIN Model Checker , 2003 .

[14]  R. Varga,et al.  Proof of Theorem 4 , 1983 .

[15]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[16]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..

[17]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[18]  Stephen N. Freund,et al.  Exploiting purity for atomicity , 2004, IEEE Transactions on Software Engineering.