Pointer Race Freedom
We propose a novel notion of pointer race for concurrent programs manipulating a shared heap. A pointer race is an access to a memory address which was freed, and it is out of the accessor’s control whether or not the cell has been re-allocated. We establish two results. (1) Under the assumption of pointer race freedom, it is sound to verify a program running under explicit memory management as if it was running with garbage collection. (2) Even the requirement of pointer race freedom itself can be verified under the garbage-collected semantics. We then prove analogues of the theorems for a stronger notion of pointer race needed to cope with performance-critical code purposely using racy comparisons and even racy dereferences of pointers. As a practical contribution, we apply our results to optimize a thread-modular analysis under explicit memory management. Our experiments confirm a speed-up of up to two orders of magnitude.
KeywordsGarbage Collection Concurrent Program Abstract Domain Valid Pointer Grace Period
- 1.Abdulla, P.A., Haziza, F., Holík, L., Jonsson, B., Rezine, A.: An integrated specification and verification technique for highly concurrent data structures. In: Piterman, N., Smolka, S.A. (eds.) TACAS 2013 (ETAPS 2013). LNCS, vol. 7795, pp. 324–338. Springer, Heidelberg (2013) CrossRefGoogle Scholar
- 7.Gotsman, A., Berdine, J., Cook, B., Sagiv, M.: Thread-modular shape analysis. In: PLDI, pp. 266–277. ACM (2007)Google Scholar
- 9.Haziza, F., Holík, L., Meyer, R., Wolff, S.: Pointer race freedom. Technical Report FIT-TR-2015-05, Brno University of Technology, FIT (2015)Google Scholar
- 14.Treiber, R.K.: Systems programming: coping with parallelism. In: RJ5118 (1986)Google Scholar