Abstract
Mainstream languages such as C/C++ (with Pthreads), Java, and .NET provide programmers with both static and dynamic barriers for synchronizing concurrent threads in fork/join programs. However, such barrier synchronization in fork/join programs is hard to verify since programmers must not only keep track of the dynamic number of participating threads, but also ensure that all participants proceed in correctly synchronized phases. As barriers are commonly used in practice, verifying correct synchronization of barriers can provide compilers and analysers with important phasing information for improving the precision of their analyses and optimizations.
In this paper, we propose an approach for statically verifying correct synchronization of static and dynamic barriers in fork/join programs. We introduce the notions of bounded permissions and phase numbers for keeping track of the number of participating threads and barrier phases respectively. The approach has been proven sound, and a prototype of it (named VeriBSync) has been implemented for verifying barrier synchronization of realistic programs in the SPLASH-2 benchmark suite.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
The Open Group Base Specifications Issue 7 IEEE Std 1003 (January 2008), http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html
Aiken, A., Gay, D.: Barrier Inference. In: POPL, pp. 342–354 (1998)
Bierhoff, K., Aldrich, J.: Modular typestate checking of aliased objects. In: OOPSLA, pp. 301–320 (2007)
Bornat, R., Calcagno, C., O’Hearn, P., Parkinson, M.: Permission Accounting in Separation Logic. In: POPL, pp. 259–270. ACM, New York (2005)
Boyland, J.: Checking Interference with Fractional Permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003)
Dockins, R., Hobor, A., Appel, A.W.: A Fresh Look at Separation Algebras and Share Accounting. In: Hu, Z. (ed.) APLAS 2009. LNCS, vol. 5904, pp. 161–177. Springer, Heidelberg (2009)
Freeman, A.: Pro.NET 4 Parallel Programming in C#. Apress (2010)
Gherghina, C.: Personal communication (April 2013)
González, J.F.: Java 7 Concurrency Cookbook. Packt. Pub. Limited (2012)
Hobor, A., Gherghina, C.: Barriers in concurrent separation logic: Now with tool support? Logical Methods in Computer Science 8(2) (2012)
Jeremiassen, T.E., Eggers, S.J.: Static Analysis of Barrier Synchronization in Explicitly Parallel Programs. In: PACT, pp. 171–180 (1994)
Kamil, A., Yelick, K.: Concurrency Analysis for Parallel Programs with Textually Aligned Barriers. In: Ayguadé, E., Baumgartner, G., Ramanujam, J., Sadayappan, P. (eds.) LCPC 2005. LNCS, vol. 4339, pp. 185–199. Springer, Heidelberg (2006)
Kamil, A., Yelick, K.: Enforcing Textual Alignment of Collectives Using Dynamic Checks. In: Gao, G.R., Pollock, L.L., Cavazos, J., Li, X. (eds.) LCPC 2009. LNCS, vol. 5898, pp. 368–382. Springer, Heidelberg (2010)
Le, D.K., Chin, W.N., Teo, Y.M.: Verification of Static and Dynamic Barrier Synchronization Using Bounded Permissions. Technical report, NUS (April 2013)
Lin, Y.: Static Nonconcurrency Analysis of OpenMP Programs. In: Mueller, M.S., Chapman, B.M., de Supinski, B.R., Malony, A.D., Voss, M. (eds.) IWOMP 2005/2006. LNCS, vol. 4315, pp. 36–50. Springer, Heidelberg (2008)
Naden, K., Bocchino, R., Aldrich, J., Bierhoff, K.: A Type System for Borrowing Permissions. In: POPL, pp. 557–570 (2012)
O’Hearn, P.W.: Resources, Concurrency and Local Reasoning. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 1–2. Springer, Heidelberg (2004)
Reynolds, J.: Separation Logic: A Logic for Shared Mutable Data Structures. In: LICS, Copenhagen, Denmark (July 2002)
Saraswat, V.A., Jagadeesan, R.: Concurrent Clustered Programming. In: Abadi, M., de Alfaro, L. (eds.) CONCUR 2005. LNCS, vol. 3653, pp. 353–367. Springer, Heidelberg (2005)
Shirako, J., Peixotto, D.M., Sarkar, V., Scherer III, W.N.: Phasers: A Unified Deadlock-free Construct for Collective and Point-to-point Synchronization. In: ICS, pp. 277–288 (2008)
Smans, J., Jacobs, B., Piessens, F.: Implicit Dynamic Frames. In: TOPLAS (2012)
Woo, S.C., Ohara, M., Torrie, E., Singh, J.P., Gupta, A.: The SPLASH-2 Programs: Characterization and Methodological Considerations. In: ICSA (1995)
Zhang, Y., Duesterwald, E.: Barrier Matching for Programs with Textually Unaligned Barriers. In: PPoPP, pp. 194–204 (2007)
Zhang, Y., Duesterwald, E., Gao, G.R.: Concurrency Analysis for Shared Memory Programs with Textually Unaligned Barriers. In: Adve, V., Garzarán, M.J., Petersen, P. (eds.) LCPC 2007. LNCS, vol. 5234, pp. 95–109. Springer, Heidelberg (2008)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Le, DK., Chin, WN., Teo, YM. (2013). Verification of Static and Dynamic Barrier Synchronization Using Bounded Permissions. In: Groves, L., Sun, J. (eds) Formal Methods and Software Engineering. ICFEM 2013. Lecture Notes in Computer Science, vol 8144. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-41202-8_16
Download citation
DOI: https://doi.org/10.1007/978-3-642-41202-8_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-41201-1
Online ISBN: 978-3-642-41202-8
eBook Packages: Computer ScienceComputer Science (R0)