Skip to main content

Dynamic Validation of Contracts in Concurrent Code

  • Conference paper
  • First Online:
Computer Aided Systems Theory – EUROCAST 2015 (EUROCAST 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9520))

Included in the following conference series:

Abstract

Multi-threaded programs allow one to achieve better performance by doing a lot of work in parallel using multiple threads. Such parallel programs often contain code blocks that a thread must execute atomically, i.e., with no interference from the other threads of the program. Failing to execute these code blocks atomically leads to errors known as atomicity violations. However, frequently it not obvious to tell when a piece of code should be executed atomically, especially when that piece of code contains calls to some third-party library functions, about which the programmer has little or no knowledge at all. One solution to this problem is to associate a contract with such a library, telling the programmer how the library functions should be used, and then check whether the contract is indeed respected. For contract validation, static approaches have been proposed, with known limitations on precision and scalability. In this paper, we propose a dynamic method for contract validation, which is more precise and scalable than static approaches.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Star-free regular expressions are used in the static contract validation approach [10]. We can, however, easily generalize our approach to general regular expressions.

References

  1. Cheon, Y., Perumandla, A.: Specifying and checking method call sequences of java programs. Softw. Qual. Control 15(1), 7–25 (2007)

    Article  Google Scholar 

  2. Demeyer, R., Vanhoof, W.: Static application-level race detection in STM haskell using contracts. In: Proceedings of PLACCES. Open Publishing Association (2013)

    Google Scholar 

  3. Dias, R.J., Pessanha, V., Lourenço, J.M.: Precise detection of atomicity violations. In: Biere, A., Nahir, A., Vos, T. (eds.) HVC. LNCS, vol. 7857, pp. 8–23. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  4. Edelstein, O., Farchi, E., Goldin, E., Nir, Y., Ratsaby, G., Ur, S.: Framework for testing multi-threaded java programs. Concurrency Comput. Pract. Experience 15(3–5), 485–499 (2003)

    Article  MATH  Google Scholar 

  5. Elmas, T., Qadeer, S., Tasiran, S.: Goldilocks: a race and transaction-aware java runtime. In: Proceedings of PLDI 2007. ACM (2007)

    Google Scholar 

  6. Fiedor, J., Hrubá, V., Křena, B., Letko, Z., Ur, S., Vojnar, T.: Advances in noise-based testing. STVR 24(7), 1–38 (2014)

    Google Scholar 

  7. Hurlin, C.: Specifying and checking protocols of multithreaded classes. In: Proceedings of SAC 2009, pp. 587–592. ACM (2009)

    Google Scholar 

  8. Meyer, B.: Applying “design by contract”. Computer 25(10), 40–51 (1992)

    Article  Google Scholar 

  9. Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.: Eraser: a dynamic data race detector for multi-threaded programs. In: Proceedings of SOSP 1997. ACM (1997)

    Google Scholar 

  10. Sousa, D.G., Dias, R.J., Ferreira, C., Lourenço, J.M.: Preventing atomicity violations with contracts. eprint arXiv:1505.02951, May 2015

Download references

Acknowledgements

This work was supported by the ESF COST Action IC1001 (Euro-TM), the COST project LD14001 and the Kontakt II project LH13265 of the Czech ministry of education, the BUT project FIT-S-14-2486, the EU/Czech IT4Innovations Centre of Excellence project CZ.1.05/1.1.00/02.0070, the EU/Czech Interdisciplinary Excellence Research Teams Establishment project CZ.1.07/2.3.00/30.0005, and the Portuguese National Science Foundation in the strategic project FCT/MEC NOVA LINCS PEst UID/CEC/04516/2013.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jan Fiedor .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Fiedor, J., Letko, Z., Lourenço, J., Vojnar, T. (2015). Dynamic Validation of Contracts in Concurrent Code. In: Moreno-Díaz, R., Pichler, F., Quesada-Arencibia, A. (eds) Computer Aided Systems Theory – EUROCAST 2015. EUROCAST 2015. Lecture Notes in Computer Science(), vol 9520. Springer, Cham. https://doi.org/10.1007/978-3-319-27340-2_69

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-27340-2_69

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-27339-6

  • Online ISBN: 978-3-319-27340-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics