Cooperative types for controlling thread interference in Java
Authors:
Open Access
- 15 July 2012
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 112, 232-242
Abstract
Multithreaded programs are notoriously prone to unintended interference between concurrent threads. To address this problem, we argue that yield annotations in the source code should document all thread interference, and we present a type system for verifying the absence of undocumented interference in Java programs. Under this type system, well-typed programs behave as if context switches occur only at yield annotations. Thus, well-typed programs can be understood using intuitive sequential reasoning, except where yield annotations remind the programmer to account for thread interference. Experimental results show that yield annotations describe thread interference more precisely than prior techniques based on method-level atomicity specifications. In particular, yield annotations reduce the number of interference points one must reason about by an order of magnitude. The type system is also more precise than prior methods targeting race freedom. Moreover, yield annotations serve to highlight all known concurrency defects in our benchmark suite.Keywords
This publication has 35 references indexed in Scilit:
- FastTrackCommunications of the ACM, 2010
- SingleTrack: A Dynamic Determinism Checker for Multithreaded Programs2009
- Monitoring Atomicity in Concurrent Programs2008
- Types for atomicityACM Transactions on Programming Languages and Systems, 2008
- Types for safe lockingACM Transactions on Programming Languages and Systems, 2006
- Verifying Atomicity Specifications for Concurrent Object-Oriented Software Using Model-Checking2004
- Resource Control for Synchronous Cooperative Threads2004
- EraserACM Transactions on Computer Systems, 1997
- Shared memory consistency models: a tutorialComputer, 1996
- ReductionCommunications of the ACM, 1975