ABSTRACT
Deadlock in multithreaded programs is an increasingly important problem as ubiquitous multicore architectures force parallelization upon an ever wider range of software. This paper presents a theoretical foundation for dynamic deadlock avoidance in concurrent programs that employ conventional mutual exclusion and synchronization primitives (e.g., multithreaded C/Pthreads programs). Beginning with control flow graphs extracted from program source code, we construct a formal model of the program and then apply Discrete Control Theory to automatically synthesize deadlock-avoidance control logic that is implemented by program instrumentation. At run time, the control logic avoids deadlocks by postponing lock acquisitions. Discrete Control Theory guarantees that the program instrumented with our synthesized control logic cannot deadlock. Our method furthermore guarantees that the control logic is maximally permissive: it postpones lock acquisitions only when necessary to prevent deadlocks, and therefore permits maximal runtime concurrency. Our prototype for C/Pthreads scales to real software including Apache, OpenLDAP, and two kinds of benchmarks, automatically avoiding both injected and naturally occurring deadlocks while imposing modest runtime overheads.
- Apache. Apache bug database, 2008. https://issues.apache.org/bugzilla/index.cgi.Google Scholar
- E. R. Boer and T. Murata. Generating basis siphons and traps of Petri nets using the sign incidence matrix. IEEE Trans. on Circuits and Systems-I, 41(4):266--271, April 1994.Google Scholar
Cross Ref
- C. G. Cassandras and S. Lafortune. Introduction to Dsicrete Event Systems. Springer, second edition, 2007. Google Scholar
Digital Library
- S. Cherem, T. Chilimbi, and S. Gulwani. Inferring locks for atomic sections. In PLDI, June 2008. Google Scholar
Digital Library
- M. Emmi, J. S. Fischer, R. Jhala, and R. Majumdar. Lock allocation. In POPL, 2007. Google Scholar
Digital Library
- D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, 2003. Google Scholar
Digital Library
- J. L. Hellerstein, Y. Diao, S. Parekh, and D. M. Tilbury. Feedback Control of Computing Systems. Wiley, 2004. Google Scholar
Digital Library
- L. Holloway, B. Krogh, and A. Giua. A survey of Petri net methods for controlled discrete event systems. Discrete Event Dynamic Systems: Theory and Applications, 7(2):151--190, 1997. Google Scholar
Digital Library
- Intel. Intel C++ STM Compiler, Prototype Edition, January 2008.Google Scholar
- M. V. Iordache and P. J. Antsaklis. Supervisory Control of Concurrent Systems: A Petri Net Structural Approach. Birkhäuser, 2006. Google Scholar
Digital Library
- M. Isard and A. Birrell. Automatic mutual exclusion. In Proc. 11th Workshop on Hot Topics in Operating Systems, May 2007. Google Scholar
Digital Library
- K. M. Kavi, A. Moshtaghi, and D. Chen. Modeling multithreaded applications using Petri nets. International Journal of Parallel Programming, 30(5):353--371, October 2002. Google Scholar
Digital Library
- J. Larus and R. Rajwar. Transactional Memory. Morgan & Claypool, 2007.Google Scholar
- Z. Li, M. Zhou, and N. Wu. A survey and comparison of Petri netbased deadlock prevention policies for flexible manufacturing systems. IEEE Trans. on Systems, Man, and Cybernetics-Part C, 38(2):173--188, March 2008. Google Scholar
Digital Library
- S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In ASPLOS, 2008. Google Scholar
Digital Library
- B. McCloskey, F. Zhou, D. Gay, and E. Brewer. Autolocker: Synchronization inference for atomic sections. In POPL, 2006. Google Scholar
Digital Library
- T. Murata. Petri nets: Properties, analysis and applications. Proceedings of the IEEE, 77(4):541--580, April 1989.Google Scholar
Cross Ref
- OpenImpact. OpenIMPACT, 2008. http://www.gelato.uiuc.edu/.Google Scholar
- OpenLDAP. OpenLDAP Issue Tracking System, 2008. http://www.openldap.org/its/.Google Scholar
- C. A. Petri. Kommunikation mit Automaten. PhD thesis, Bonn: Institut für Instrumentelle Mathematik, Schriffen des IIM Nr.3, 1962.Google Scholar
- P.J. Ramadge and W.M. Wonham. Supervisory control of a class of discrete event processes. SIAM J. Control Optim., 25(1), 1987. Google Scholar
Digital Library
- W. Reisig. Petri nets. In EATCS Monographs on Theoretical Computer Science, volume 4. Springer-Verlag, Berlin, 1985.Google Scholar
Digital Library
- S. A. Reveliotis. Real-Time Management of Resource Allocation Systems: A Discrete-Event Systems Approach. Springer, New York, NY, 2005.Google Scholar
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM TOCS, 15(4):391--411, November 1997. Google Scholar
Digital Library
- Y. Wang, T. Kelly, and S. Lafortune. Discrete control for safe execution of IT automation workflows. In EuroSys, 2007. Google Scholar
Digital Library
- Y. Wang, T. Kelly, M. Kudlur, S. Lafortune, and S. Mahlke. Gadara: Dynamic deadlock avoidance for multithreaded programs. In OSDI, 2008a. Google Scholar
Digital Library
- Y. Wang, T. Kelly, M. Kudlur, S. Mahlke, and S. Lafortune. The application of supervisory control to deadlock avoidance in concurrent software. In Workshop on Discrete Event Systems, May 2008b.Google Scholar
- AdamWelc, Bratin Saha, and Ali-Reza Adl-Tabatabai. Irrevocable transactions and their applications. In SPAA, June 2008.Google Scholar
Index Terms
The theory of deadlock avoidance via discrete control
Recommendations
The theory of deadlock avoidance via discrete control
POPL '09Deadlock in multithreaded programs is an increasingly important problem as ubiquitous multicore architectures force parallelization upon an ever wider range of software. This paper presents a theoretical foundation for dynamic deadlock avoidance in ...
Avoiding deadlock avoidance
PACT '10: Proceedings of the 19th international conference on Parallel architectures and compilation techniquesThe evolution of processor architectures from single core designs with increasing clock frequencies to multi-core designs with relatively stable clock frequencies has fundamentally altered application design. Since application programmers can no longer ...









Comments