Eliminating Concurrency Bugs in Multithreaded Software: A New Approach Based on Discrete-Event Control

Computer hardware is moving from uniprocessor to multicore architectures. One problem arising in this evolution is that only parallel software can exploit the full performance potential of multicore architectures, and parallel software is far harder to write than conventional serial software. One important class of failures arising in parallel software is circular-wait deadlock in multithreaded programs. In our ongoing Gadara project, we use a special class of Petri nets, called Gadara nets, to systematically model multithreaded programs with lock allocation and release operations. In this paper, we propose an efficient optimal control synthesis methodology for ordinary Gadara nets that exploits the structural properties of Gadara nets via siphon analysis. Optimality in this context refers to the elimination of deadlocks in the program with minimally restrictive control logic. We formally establish a set of important properties of the proposed control synthesis methodology, and show that our algorithms never synthesize redundant control logic. We conduct experiments to evaluate the efficiency and scalability of the proposed methodology, and discuss the application of our results to real-world concurrent software.

[1]  Éric Rutten,et al.  Contracts for modular discrete controller synthesis , 2010, LCTES '10.

[2]  Scott A. Mahlke,et al.  Optimal Liveness-Enforcing Control for a Class of Petri Nets Arising in Multithreaded Software , 2013, IEEE Transactions on Automatic Control.

[3]  Alberto L. Sangiovanni-Vincentelli,et al.  Schedulability Analysis of Petri Nets Based on Structural Properties , 2006, Sixth International Conference on Application of Concurrency to System Design (ACSD'06).

[4]  Panos J. Antsaklis,et al.  Supervisory Control of Concurrent Systems: A Petri Net Structural Approach (M.V. Iordache and P.J. Antsaklis; 2008) [Book reviews] , 2006, IEEE Transactions on Automatic Control.

[5]  Éric Rutten,et al.  A Case Study on Controller Synthesis for Data-Intensive Embedded Systems , 2009, 2009 International Conference on Embedded Software and Systems.

[6]  Stéphane Lafortune,et al.  Modeling, analysis, and control of a class of resource allocation systems arising in concurrent software , 2012 .

[7]  Yuanyuan Zhou,et al.  CTrigger: exposing atomicity violation bugs from their hiding places , 2009, ASPLOS.

[8]  Jürgen Dingel,et al.  Concurrency control generation for dynamic threads using Discrete-Event Systems , 2009, 2009 47th Annual Allerton Conference on Communication, Control, and Computing (Allerton).

[9]  Edsger W. Dijkstra,et al.  The Mathematics Behind the Banker’s Algorithm , 1982 .

[10]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[11]  Scott A. Mahlke,et al.  Gadara: Dynamic Deadlock Avoidance for Multithreaded Programs , 2008, OSDI.

[12]  Yixin Diao,et al.  Feedback Control of Computing Systems , 2004 .

[13]  Spyros Reveliotis Real-time management of resource allocation systems : a discrete event systems approach , 2004 .

[14]  Asok Ray,et al.  Supervisory control of software systems , 2004, IEEE Transactions on Computers.

[15]  Emery D. Berger,et al.  Exterminator: automatically correcting memory errors with high probability , 2007, PLDI '07.

[16]  Scott A. Mahlke,et al.  Concurrency bugs in multithreaded software: modeling and analysis using Petri nets , 2013, Discret. Event Dyn. Syst..

[17]  Alessandro Giua,et al.  Petri nets as discrete event models for supervisory control , 1992 .

[18]  Shmuel Ur,et al.  Deadlocks: From Exhibiting to Healing , 2008, RV.

[19]  Thomas Ball,et al.  Finding and Reproducing Heisenbugs in Concurrent Programs , 2008, OSDI.

[20]  M. Omizo,et al.  Modeling , 1983, Encyclopedic Dictionary of Archaeology.

[21]  Panos J. Antsaklis,et al.  Petri nets and programming: A survey , 2009, 2009 American Control Conference.

[22]  Panos J. Antsaklis,et al.  Supervisory Control of Discrete Event Systems Using Petri Nets , 1998, The International Series on Discrete Event Dynamic Systems.

[23]  Tadao Murata,et al.  Petri nets: Properties, analysis and applications , 1989, Proc. IEEE.

[24]  Scott A. Mahlke,et al.  Eliminating Concurrency Bugs with Control Engineering , 2009, Computer.

[25]  Feng Chu,et al.  Deadlock analysis of Petri nets using siphons and mathematical programming , 1997, IEEE Trans. Robotics Autom..

[26]  Marian V Iordache,et al.  Concurrent program synthesis based on supervisory control , 2010, Proceedings of the 2010 American Control Conference.

[27]  Yin Wang,et al.  Software failure avoidance using discrete control theory , 2009 .

[28]  Panos J. Antsaklis,et al.  Feedback control of Petri nets based on place invariants , 1994, Proceedings of 1994 33rd IEEE Conference on Decision and Control.

[29]  Scott A. Mahlke,et al.  The theory of deadlock avoidance via discrete control , 2009, POPL '09.

[30]  Jürgen Dingel,et al.  Generation of concurrency control code using discrete-event systems theory , 2008, SIGSOFT '08/FSE-16.

[31]  Alessandro Giua,et al.  Generalized mutual exclusion contraints on nets with uncontrollable transitions , 1992, [Proceedings] 1992 IEEE International Conference on Systems, Man, and Cybernetics.