Static Analysis of Atomicity for Programs with Lock-Free Synchronization∗


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

7 Figures and Tables

Cite this paper

@inproceedings{Wang2004StaticAO, title={Static Analysis of Atomicity for Programs with Lock-Free Synchronization∗}, author={Liqiang Wang and Scott D. Stoller}, year={2004} }