| | |
Summary: Object Types against Races
Cormac Flanagan and Martn Abadi
[flanagan|ma]@pa.dec.com
Systems Research Center, Compaq
Abstract. This paper investigates an approach for statically preventing
race conditions in an objectoriented language. The setting of this work is
a variant of Gordon and Hankin's concurrent object calculus. We enrich
that calculus with a form of dependent object types that enables us
to verify that threads invoke and update methods only after acquiring
appropriate locks. We establish that welltyped programs do not have
race conditions.
1 Introduction
Concurrent objectoriented programs su#er from many of the errors common in
concurrent programs of other sorts. In particular, the use of objects does not
diminish the importance of careful synchronization. With objects or without
them, improper synchronization may lead to race conditions (that is, two pro
cesses accessing a shared resource simultaneously) and ultimately to incorrect
behavior.
A standard approach for eliminating race conditions consists in protecting
each shared resource with a lock, requiring that a process acquires the cor
|