Verifying liveness for asynchronous programs

Asynchronous or 'event-driven' programming is a popular technique to efficiently and flexibly manage concurrent interactions. In these programs, the programmer can post tasks that get stored in a task buffer and get executed atomically by a non-preemptive scheduler at a future point. We give a decision procedure for the fair termination property of asynchronous programs. The fair termination problem asks, given an asynchronous program and a fairness condition on its executions, does the program always terminate on fair executions? The fairness assumptions rule out certain undesired bad behaviors, such as where the scheduler ignores a set of posted tasks forever, or where a non-deterministic branch is always chosen in one direction. Since every liveness property reduces to a fair termination property, our decision procedure extends to liveness properties of asynchronous programs. Our decision procedure for the fair termination of asynchronous programs assumes all variables are finite-state. Even though variables are finite-state, asynchronous programs can have an unbounded stack from recursive calls made by tasks, as well as an unbounded task buffer of pending tasks. We show a reduction from the fair termination problem for asynchronous programs to fair termination problems on Petri Nets, and our main technical result is a reduction of the latter problem to Presburger satisfiability. Our decidability result is in contrast to multithreaded recursive programs, for which liveness properties are undecidable. While we focus on fair termination, we show our reduction to Petri Nets can be used to prove related properties such as fair nonstarvation (every posted task is eventually executed) and safety properties such as boundedness (find a bound on the maximum number of posted tasks that can be in the task buffer at any point).

[1]  Mahesh Viswanathan,et al.  Decidability Results for Well-Structured Transition Systems with Auxiliary Storage , 2007, CONCUR.

[2]  Panagiotis Manolios,et al.  Termination Analysis with Calling Context Graphs , 2006, CAV.

[3]  Andrey Rybalchenko,et al.  Temporal verification with transition invariants , 2004 .

[4]  Sriram K. Rajamani,et al.  Programming asynchronous layers with CLARITY , 2007, ESEC-FSE '07.

[5]  Zohar Manna,et al.  Temporal verification of reactive systems - safety , 1995 .

[6]  Rupak Majumdar,et al.  Interprocedural analysis of asynchronous programs , 2007, POPL '07.

[7]  Robert Szewczyk,et al.  System architecture directions for networked sensors , 2000, ASPLOS IX.

[8]  Rüdiger Valk,et al.  Petri Nets and Regular Languages , 1981, J. Comput. Syst. Sci..

[9]  G. Ramalingam,et al.  Context-sensitive synchronization-sensitive analysis is undecidable , 2000, TOPL.

[10]  Richard M. Karp,et al.  Parallel Program Schemata , 1969, J. Comput. Syst. Sci..

[11]  Petr Jancar,et al.  Decidability of a Temporal Logic Problem for Petri Nets , 1990, Theor. Comput. Sci..

[12]  Peng Li,et al.  Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives , 2007, PLDI '07.

[13]  Willy Zwaenepoel,et al.  Flash: An efficient and portable Web server , 1999, USENIX Annual Technical Conference, General Track.

[14]  Charles Rackoff,et al.  The Covering and Boundedness Problems for Vector Addition Systems , 1978, Theor. Comput. Sci..

[15]  Bernhard Steffen,et al.  Pushdown Processes: Parallel Composition and Model Checking , 1994, CONCUR.

[16]  Eddie Kohler,et al.  Events Can Make Sense , 2007, USENIX Annual Technical Conference.

[17]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[18]  Amir Pnueli,et al.  Impartiality, Justice and Fairness: The Ethics of Concurrent Termination , 1981, ICALP.

[19]  Jeffrey D. Ullman,et al.  Introduction to automata theory, languages, and computation, 2nd edition , 2001, SIGA.

[20]  David E. Culler,et al.  The nesC language: A holistic approach to networked embedded systems , 2003, PLDI.

[21]  Moshe Y. Vardi Verification of Concurrent Programs: The Automata-Theoretic Framework , 1991, Ann. Pure Appl. Log..

[22]  Eddie Kohler,et al.  The Click modular router , 1999, SOSP.

[23]  Mogens Nielsen,et al.  Decidability Issues for Petri Nets - a survey , 1994, Bull. EATCS.

[24]  Eddie Kohler,et al.  Making Events Less Slippery with eel , 2005, HotOS.

[25]  Zohar Manna,et al.  Temporal Verification of Reactive Systems , 1995, Springer New York.

[26]  Thomas Schwentick,et al.  Counting in Trees for Free , 2004, ICALP.

[27]  J. Berstel,et al.  Context-free languages , 1993, SIGA.

[28]  Mahesh Viswanathan,et al.  Model Checking Multithreaded Programs with Asynchronous Atomic Methods , 2006, CAV.

[29]  Rüdiger Valk,et al.  The residue of vector sets with applications to decidability problems in Petri nets , 1985, Acta Informatica.

[30]  Rupak Majumdar,et al.  Tasks: language support for event-driven programming , 2007, PEPM '07.

[31]  Wolfgang Reisig Petri Nets: An Introduction , 1985, EATCS Monographs on Theoretical Computer Science.

[32]  Hsu-Chun Yen,et al.  A Unified Approach for Deciding the Existence of Certain Petri Net Paths , 1992, Inf. Comput..

[33]  I. Walukiewicz Pushdown Processes: Games and Model Checking , 1996 .

[34]  Thomas W. Reps,et al.  Precise interprocedural dataflow analysis via graph reachability , 1995, POPL '95.