Types for atomicity
Open Access
- 1 July 2008
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 30 (4) , 1-53
- https://doi.org/10.1145/1377492.1377495
Abstract
Atomicity is a fundamental correctness property in multithreaded programs. A method is atomic if, for every execution, there is an equivalent serial execution in which the actions of the method are not interleaved with actions of other threads. Atomic methods are amenable to sequential reasoning, which significantly facilitates subsequent analysis and verification. This article presents a type system for specifying and verifying the atomicity of methods in multithreaded Java programs using a synthesis of Lipton's theory of reduction and type systems for race detection. The type system supports guarded, write-guarded, and unguarded fields, as well as thread-local data, parameterized classes and methods, and protected locks. We also present an algorithm for verifying atomicity via type inference. We have applied our type checker and type inference tools to a number of commonly used Java library classes and programs. These tools were able to verify the vast majority of methods in these benchmarks as atomic, indicating that atomicity is a widespread methodology for multithreaded programming. In addition, reported atomicity violations revealed some subtle errors in the synchronization disciplines of these programs.Keywords
Funding Information
- National Science Foundation (3.41E+26)
This publication has 52 references indexed in Scilit:
- Types for safe lockingACM Transactions on Programming Languages and Systems, 2006
- Checking Concise Specifications for Multithreaded Software.The Journal of Object Technology, 2004
- EraserACM Transactions on Computer Systems, 1997
- Evaluating deadlock detection methods for concurrent softwareIEEE Transactions on Software Engineering, 1996
- Polymorphic type, region and effect inferenceJournal of Functional Programming, 1992
- Linearizability: a correctness condition for concurrent objectsACM Transactions on Programming Languages and Systems, 1990
- Time, clocks, and the ordering of events in a distributed systemCommunications of the ACM, 1978
- Process structuring, synchronization, and recovery using atomic actionsACM SIGSOFT Software Engineering Notes, 1977
- ReductionCommunications of the ACM, 1975
- MonitorsCommunications of the ACM, 1974