Skip to main content
Log in

Formal verification of concurrent programs with read-write locks

  • Research Article
  • Published:
Frontiers of Computer Science in China Aims and scope Submit manuscript

Abstract

Read-write locking is an important mechanism to improve concurrent granularity, but it is difficult to reason about the safety of concurrent programs with read-write locks. Concurrent separation logic (CSL) provides a simple but powerful technique for locally reasoning about concurrent programs with mutual exclusive locks. Unfortunately, CSL cannot be directly applied to reasoning about concurrent programs with read-write locks due to the different concurrent control mechanisms.

This paper focuses on extending CSL and presenting a proof-carrying code (PCC) system for reasoning about concurrent programs with read-write locks. We extend the heap model with a writing permission set, denoted as logical heap, then define “strong separation” and “weak separation” over logical heap. Following CSL’s local-reasoning idea, we develop a novel program logic to enforce weak separations of heap between different threads and provide verification of concurrent programs with read-write locks.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Hearn O P W. Resources, concurrency, and local reasoning. Theoretical Computer Science, 2007, 375(1–3): 271–307

    MATH  MathSciNet  Google Scholar 

  2. Hoare C A R. Towards a theory of parallel programming. In: Hoare C A R and Perrott R H, eds. Operating Systems Techniques. Academic Press, 1972, 61–71

  3. The Coq Development Team. The Coq proof assistant reference manual. The Coq release v8.0, October 2004

  4. Necula G. Proof-carrying code. In: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languges. ACM Press, January 1997, 106–119

  5. Reynolds J C. Separation logic: A logic for shared mutable data structures. In: Proceedings of the 17th IEEE Symposium on Logic in Computer Science, July 2002, 55–74

  6. Yu D C, Shao Z. Verification of safety properties for concurrent assembly code. In: Proceedings of the 9th ACM SIGPLAN International Conference on Functional Programming, September 2004, 19–21

  7. Hearn O PW. Resources, concurrency and local reasoning. In: Proceedings of the 15th International Conference on Concurrency Theory, 2004, LNCS, 3170: 49–67

  8. Wright A K, Felleisen M. A syntactic approach to type soundness. Information and Computation, 1994, 115(1): 38–94

    Article  MATH  MathSciNet  Google Scholar 

  9. The Coq Development Team. The Coq proof assistant reference manual. The Coq release v7.1, October 2001

  10. Owicki S, Gries D. Verifying properties of parallel programs: an axiomatic approach. Communications of the ACM, 1976, 19(5): 279–285

    Article  MATH  MathSciNet  Google Scholar 

  11. Jones C B. Tentative steps toward a development method for interfering programs. ACM Transactions on Programming Languages and Systems, 1983, 5(4): 596–619

    Article  MATH  Google Scholar 

  12. Feng X, Shao Z. Modular verification of concurrent assembly code with dynamic thread creation and termination. In: Proceedings of the 10th ACM SIGPLAN international conference on Functional programming, 2005, 26–28

  13. Feng X, Ferreira R, Shao Z. On the relationship between concurrent separation logic and assume-guarantee reasoning. In: Proceedings of the 16th European Symposium on Programming, 2007, 173–188

  14. Brookes S. A semantics for concurrent separation logic. Theoretical Computer Science, 2007, 375: 227–270

    Article  MATH  MathSciNet  Google Scholar 

  15. Ishtiaq S S, Hearn O P W. BI as an assertion language for mutable data structures. In: Proceedings of the 28th ACM SIGPLANSIGACT symposium on Principles of Programming Languages, 2001, 14–26

  16. Vafeiadis V, Parkinson M J. A marriage of rely/guarantee and separation logic. In: Proceedings of the 18th International Conference on Concurrency Theory, 2007, 256–271

  17. Bornat R, Calcagno C, Hearn O PW, et al. Permission accounting in separation logic. In: Proceedings of the 32nd ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, 2005, 259–270

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yu Zhang.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Fu, M., Zhang, Y. & Li, Y. Formal verification of concurrent programs with read-write locks. Front. Comput. Sci. China 4, 65–77 (2010). https://doi.org/10.1007/s11704-009-0067-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11704-009-0067-6

Keywords

Navigation