skip to main content
research-article
Open access

A programming model for concurrent object-oriented programs

Published: 12 December 2008 Publication History

Abstract

Reasoning about multithreaded object-oriented programs is difficult, due to the nonlocal nature of object aliasing and data races. We propose a programming regime (or programming model) that rules out data races, and enables local reasoning in the presence of object aliasing and concurrency. Our programming model builds on the multithreading and synchronization primitives as they are present in current mainstream programming languages. Java or C# programs developed according to our model can be annotated by means of stylized comments to make the use of the model explicit. We show that such annotated programs can be formally verified to comply with the programming model. If the annotated program verifies, the underlying Java or C# program is guaranteed to be free from data races, and it is sound to reason locally about program behavior. Verification is modular: a program is valid if all methods are valid, and validity of a method does not depend on program elements that are not visible to the method. We have implemented a verifier for programs developed according to our model in a custom build of the Spec# programming system, and we have validated our approach on a case study.

References

[1]
Ábrahám-Mumm, E., de Boer, F. S., de Roever, W.-P., and Steffen, M. 2002. Verification for Java's reentrant multithreading concept. In Proceedings of the Foundations of Software Science and Computation Structures (FoSSaCS), M. Nielsen and U. Engberg, Eds. Lecture Notes in Computer Science, vol. 2303. Springer, 5--20.
[2]
Barnett, M., Chang, B.-Y. E., DeLine, R., Jacobs, B., and Leino, K. R. M. 2006. Boogie: A modular reusable verifier for object-oriented programs. In Proceedings of the Formal Methods for Components and Objects (FMCO), F. S. de Boer, M. M. Bonsangue, S. Graf, and W.-P. de Roever, Eds. Lecture Notes in Computer Science, vol. 4111. Springer, 364--387.
[3]
Barnett, M., DeLine, R., Fähndrich, M., Leino, K. R. M., and Schulte, W. 2004. Verification of object-oriented programs with invariants. J. Obj. Techn. 3, 6, 27--56.
[4]
Barnett, M., Leino, K. R. M., and Schulte, W. 2004. The Spec# programming system: An overview. In Proceedings of the Construction and Analysis of Safe, Secure, and Interoperable Smart Devices (CASSIS), G. Barthe, L. Burdy, M. Huisman, J.-L. Lanet, and T. Muntean, Eds. Lecture Notes in Computer Science, vol. 3362. Springer, 49--69.
[5]
Boyapati, C., Lee, R., and Rinard, M. 2002. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of the Object-Oriented Programming Systems, Languages and Applications (OOPSLA), S. Matsuoka, Ed. SIGPLAN Notices 37, 11, 211--230.
[6]
Detlefs, D. L., Leino, K. R. M., Nelson, G., and Saxe, J. B. 1998. Extended static checking. Res. Rep. 159, Compaq Systems Research Center.
[7]
Flanagan, C. and Freund, S. N. 2004. Atomizer: A dynamic atomicity checker for multithreaded programs. In Proceedings of the Principles of Programming Languages (POPL), X. Leroy, Ed. ACM, 256--267.
[8]
Flanagan, C., Freund, S. N., Qadeer, S., and Seshia, S. A. 2005. Modular verification of multithreaded programs. Theor. Comput. Sci. 338, 1-3, 153--183.
[9]
Flanagan, C., Leino, K. R. M., Lillibridge, M., Nelson, G., Saxe, J. B., and Stata, R. 2002. Extended static checking for Java. In Proceedings of the Programming Language Design and Implementation (PLDI), L. J. Hendren, Ed. SIGPLAN Notices 37, 5, 234--245.
[10]
Flanagan, C. and Qadeer, S. 2003. A type and effect system for atomicity. In Proceedings of the Programming Language Design and Implementation (PLDI), S. Amarasinghe, Ed. ACM, 338--349.
[11]
Freund, S. N. and Qadeer, S. 2004. Checking concise specifications for multithreaded software. J. Obj. Techn. 3, 6, 81--101.
[12]
Gosling, J., Joy, B., Steele, G., and Bracha, G. 2005. The Java Language Specification (3rd Edition). Prentice Hall.
[13]
Hoare, C. A. R. 1974. Monitors: An operating system structuring concept. Comm. ACM 17, 10, 549--557.
[14]
Jacobs, B. 2007. A statically verifiable programming model for concurrent object-oriented programs. Ph.D. thesis, Department of Computer Science, Katholieke Universiteit Leuven.
[15]
Jacobs, B., Leino, K. R. M., Piessens, F., and Schulte, W. 2005a. Safe concurrency for aggregate objects with invariants. In Proceedings of the Software Engineering and Formal Methods (SEFM), B. K. Aichernig and B. Beckert, Eds. IEEE Computer Society, 137--147.
[16]
Jacobs, B., Leino, K. R. M., Piessens, F., and Schulte, W. 2005b. Safe concurrency for aggregate objects with invariants: Soundness proof. Tech. rep. MSR-TR-2005-85, Microsoft Research.
[17]
Jacobs, B., Smans, J., Piessens, F., and Schulte, W. 2006. A statically verifiable programming model for concurrent object-oriented programs. In Proceedings of the International Conference on Formal Engineering Methods (ICFEM), Z. Liu and J. He, Eds. Lecture Notes in Computer Science, vol. 4260. Springer, 420--439.
[18]
Kassios, I. T. 2006. Dynamic frames: Support for framing, dependencies and sharing without restrictions. In Proceedings of the Formal Methods (FM), J. Misra, T. Nipkow, and E. Sekerinski, Eds. Lecture Notes in Computer Science, vol. 4085. Springer, 268--283.
[19]
Qadeer, S., Rajamani, S. K., and Rehof, J. 2004. Summarizing procedures in concurrent programs. In Proceedings of the Principles of Programming Languages (POPL), X. Leroy, Ed. ACM, 245--255.
[20]
Rodríguez, E., Dwyer, M., Flanagan, C., Hatcliff, J., Leavens, G. T., and Robby. 2005. Extending sequential specification techniques for modular specification and verification of multi-threaded programs. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), A. P. Black, Ed. Lecture Notes in Computer Science, vol. 3586. Springer, 551--576.
[21]
Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., and Anderson, T. E. 1997. Eraser: A dynamic data race detector for multi-threaded programs. ACM Trans. Comput. Syst. 15, 4, 391--411.
[22]
Welc, A., Jagannathan, S., and Hosking, A. L. 2004. Transactional monitors for concurrent objects. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), M. Odersky, Ed. Lecture Notes in Computer Science, vol. 3086. Springer, 519--542.

Cited By

View all
  • (2016)ECHO: instantaneous in situ race detection in the IDEProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2950332(775-786)Online publication date: 1-Nov-2016
  • (2016)Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software EngineeringundefinedOnline publication date: 1-Nov-2016
  • (2015)Scalable Task Scheduling and Synchronization Using Hierarchical EffectsProceedings of the 2015 International Conference on Parallel Architecture and Compilation (PACT)10.1109/PACT.2015.25(125-137)Online publication date: 18-Oct-2015
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 31, Issue 1
December 2008
261 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/1452044
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 December 2008
Accepted: 01 February 2008
Revised: 01 November 2007
Received: 01 May 2007
Published in TOPLAS Volume 31, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Aliasing
  2. data races
  3. local reasoning
  4. modular reasoning
  5. ownership
  6. verification condition generation

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)73
  • Downloads (Last 6 weeks)18
Reflects downloads up to 06 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2016)ECHO: instantaneous in situ race detection in the IDEProceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering10.1145/2950290.2950332(775-786)Online publication date: 1-Nov-2016
  • (2016)Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software EngineeringundefinedOnline publication date: 1-Nov-2016
  • (2015)Scalable Task Scheduling and Synchronization Using Hierarchical EffectsProceedings of the 2015 International Conference on Parallel Architecture and Compilation (PACT)10.1109/PACT.2015.25(125-137)Online publication date: 18-Oct-2015
  • (2014)Verifying Functional Behaviour of Concurrent ProgramsProceedings of 16th Workshop on Formal Techniques for Java-like Programs10.1145/2635631.2635849(1-6)Online publication date: 28-Jul-2014
  • (2013)VeriFast for javaAliasing in Object-Oriented Programming10.5555/2554511.2554531(407-442)Online publication date: 1-Jan-2013
  • (2013)Object ownership in program verificationAliasing in Object-Oriented Programming10.5555/2554511.2554528(289-318)Online publication date: 1-Jan-2013
  • (2013)Alias control for deterministic parallelismAliasing in Object-Oriented Programming10.5555/2554511.2554521(156-195)Online publication date: 1-Jan-2013
  • (2013)Static Application-Level Race Detection in STM Haskell using ContractsElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.137.10137(115-134)Online publication date: 8-Dec-2013
  • (2013)Alias Control for Deterministic ParallelismAliasing in Object-Oriented Programming. Types, Analysis and Verification10.1007/978-3-642-36946-9_7(156-195)Online publication date: 2013
  • (2013)VeriFast for Java: A TutorialAliasing in Object-Oriented Programming. Types, Analysis and Verification10.1007/978-3-642-36946-9_14(407-442)Online publication date: 2013
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media