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.
Similar content being viewed by others
References
Hearn O P W. Resources, concurrency, and local reasoning. Theoretical Computer Science, 2007, 375(1–3): 271–307
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
The Coq Development Team. The Coq proof assistant reference manual. The Coq release v8.0, October 2004
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
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
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
Hearn O PW. Resources, concurrency and local reasoning. In: Proceedings of the 15th International Conference on Concurrency Theory, 2004, LNCS, 3170: 49–67
Wright A K, Felleisen M. A syntactic approach to type soundness. Information and Computation, 1994, 115(1): 38–94
The Coq Development Team. The Coq proof assistant reference manual. The Coq release v7.1, October 2001
Owicki S, Gries D. Verifying properties of parallel programs: an axiomatic approach. Communications of the ACM, 1976, 19(5): 279–285
Jones C B. Tentative steps toward a development method for interfering programs. ACM Transactions on Programming Languages and Systems, 1983, 5(4): 596–619
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
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
Brookes S. A semantics for concurrent separation logic. Theoretical Computer Science, 2007, 375: 227–270
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
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
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
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-009-0067-6