Analysis of Asynchronous Programs with Event-Based Synchronization

  • Michael EmmiEmail author
  • Pierre Ganty
  • Rupak Majumdar
  • Fernando Rosa-Velardo
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9032)


Asynchronous event-driven programming has become a central model for building responsive and efficient software systems, from low-level kernel modules, device drivers, and embedded systems, to consumer application on platforms such as .Net, Android, iOS, as well as in the web browser. Being fundamentally concurrent, such systems are vulnerable to subtle and elusive programming errors which, in principle, could be systematically discovered with automated techniques such as model checking. However, current development of such automated techniques are based on formal models which make great simplifications in the name of analysis decidability: they ignore event-based synchronization, and they assume concurrent tasks execute serially. These simplifications can ultimately lead to false positives, in reporting errors which are infeasible considering event-based synchronization, as well as false negatives, overlooking errors which arise due to interaction between concurrent tasks.

In this work, we propose a formal model of asynchronous event-driven programs which goes a long way in bridging the semantic gap between programs and existing models, in particular by allowing the dynamic creation of concurrent tasks, events, task buffers, and threads, and capturing precisely the interaction between these quantities. We demonstrate that (1) the analogous program analysis problems based on our new model remain decidable, and (2) that our new model is strictly more expressive than the existing Petri net based models. Our proof relies on a class of high-level Petri nets called Data Nets, whose tokens carry names taken from an infinite and linearly ordered domain. This result represents a significant expansion to the decidability frontier for concurrent program analyses.


Model Check Linear Order Turing Machine Concurrent Task Reachability Problem 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Adya, A., Howell, J., Theimer, M., Bolosky, W.J., Douceur, J.R.: Cooperative task management without manual stack management. In: USENIX ATC, pp. 289–302. USENIX (2002)Google Scholar
  2. 2.
    Sen, K., Viswanathan, M.: Model checking multithreaded programs with asynchronous atomic methods. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 300–314. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  3. 3.
    Ganty, P., Majumdar, R.: Algorithmic verification of asynchronous programs. ACM Trans. Program. Lang. Syst. 34(1), 6 (2012)CrossRefGoogle Scholar
  4. 4.
    Mathewson, N., Provos, N.: libevent: an event notification library,
  5. 5.
    The GCD team: libdispatch,
  6. 6.
    Ramalingam, G.: Context-sensitive synchronization-sensitive analysis is undecidable. ACM Trans. Program. Lang. Syst. 22(2), 416–430 (2000)CrossRefGoogle Scholar
  7. 7.
    Brand, D., Zafiropulo, P.: On communicating finite-state machines. J. ACM 30(2), 323–342 (1983)CrossRefzbMATHMathSciNetGoogle Scholar
  8. 8.
    Reisig, W.: Place/transition systems. In: Brauer, W., Reisig, W., Rozenberg, G. (eds.) APN 1986. LNCS, vol. 254, pp. 117–141. Springer, Heidelberg (1987)Google Scholar
  9. 9.
    Lazic, R., Newcomb, T., Ouaknine, J., Roscoe, A.W., Worrell, J.: Nets with tokens which carry data. Fundam. Inform. 88(3), 251–274 (2008)zbMATHMathSciNetGoogle Scholar
  10. 10.
    Graf, S., Saïdi, H.: Construction of abstract state graphs with PVS. In: Grumberg, O. (ed.) CAV 1997. LNCS, vol. 1254, pp. 72–83. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  11. 11.
    Clarke, E.M., Emerson, E.A.: Design and synthesis of synchronization skeletons using branching-time temporal logic. In: Kozen, D. (ed.) Logic of Programs 1981. LNCS, vol. 131, pp. 52–71. Springer, Heidelberg (1982)CrossRefGoogle Scholar
  12. 12.
    Reps, T.W., Horwitz, S., Sagiv, S.: Precise interprocedural dataflow analysis via graph reachability. In: POPL 1995: Proc. 22th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 49–61. ACM (1995)Google Scholar
  13. 13.
    Abdulla, P.A., Delzanno, G., Van Begin, L.: A classification of the expressive power of well-structured transition systems. Inf. Comput. 209(3), 248–279 (2011)CrossRefzbMATHGoogle Scholar
  14. 14.
    Rosa-Velardo, F., de Frutos-Escrig, D.: Decidability and complexity of Petri nets with unordered data. Theor. Comput. Sci. 412(34), 4439–4451 (2011)CrossRefzbMATHGoogle Scholar
  15. 15.
    Rosa-Velardo, F., de Frutos-Escrig, D.: Decidability problems in Petri nets with names and replication. Fundam. Inform. 105(3), 291–317 (2010)zbMATHGoogle Scholar
  16. 16.
    Meyer, R.: On boundedness in depth in the pi-calculus. In: Fifth IFIP International Conference On Theoretical Computer Science - TCS 2008, IFIP 20th World Computer Congress, TC 1, Foundations of Computer Science, Milano, Italy, September 7-10, 2008. IFIP, vol. 273, pp. 477–489. Springer, Heidelberg (2008)Google Scholar
  17. 17.
    Chadha, R., Viswanathan, M.: Decidability results for well-structured transition systems with auxiliary storage. In: Caires, L., Vasconcelos, V.T. (eds.) CONCUR 2007. LNCS, vol. 4703, pp. 136–150. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Cai, X., Ogawa, M.: Well-structured pushdown systems. In: D’Argenio, P.R., Melgratti, H. (eds.) CONCUR 2013 – Concurrency Theory. LNCS, vol. 8052, pp. 121–136. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  19. 19.
    Atig, M.F., Bouajjani, A., Touili, T.: Analyzing asynchronous programs with preemption. In: FSTTCS 2008: Proc. IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science. LIPIcs, vol. 2, pp. 37–48. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2008)Google Scholar
  20. 20.
    D’Osualdo, E., Kochems, J., Ong, C.-H.L.: Automatic verification of erlang-style concurrency. In: Logozzo, F., Fähndrich, M. (eds.) Static Analysis. LNCS, vol. 7935, pp. 454–476. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  21. 21.
    Geeraerts, G., Heußner, A., Raskin, J.-F.: Queue-dispatch asynchronous systems. CoRR abs/1201.4871 (2012)Google Scholar
  22. 22.
    Alur, R., Madhusudan, P.: Visibly pushdown languages. In: STOC 2004: Proc. 36th Annual ACM Symposium on Theory of Computing, pp. 202–211. ACM (2004)Google Scholar
  23. 23.
    Babić, D., Rakamarić, Z.: Asynchronously communicating visibly pushdown systems. In: Beyer, D., Boreale, M. (eds.) FORTE 2013 and FMOODS 2013. LNCS, vol. 7892, pp. 225–241. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  24. 24.
    Kochems, J., Ong, C.-H.L.: Safety verification of asynchronous pushdown systems with shaped stacks. In: D’Argenio, P.R., Melgratti, H. (eds.) CONCUR 2013 – Concurrency Theory. LNCS, vol. 8052, pp. 288–302. Springer, Heidelberg (2013), CrossRefGoogle Scholar
  25. 25.
    Bouajjani, A., Emmi, M.: Analysis of recursively parallel programs. In: POPL 2012: Proc. 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 203–214. ACM (2012)Google Scholar
  26. 26.
    Atig, M.F., Bouajjani, A., Qadeer, S.: Context-bounded analysis for concurrent programs with dynamic creation of threads. Logical Methods in Computer Science 7(4) (2011)Google Scholar
  27. 27.
    Emmi, M., Lal, A., Qadeer, S.: Asynchronous programs with prioritized task-buffers. In: SIGSOFT FSE 2012: Proc. 20th ACM SIGSOFT Symposium on the Foundations of Software Engineering, p. 48. ACM (2012)Google Scholar
  28. 28.
    Qadeer, S., Rehof, J.: Context-bounded model checking of concurrent software. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 93–107. Springer, Heidelberg (2005)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Michael Emmi
    • 1
    Email author
  • Pierre Ganty
    • 1
  • Rupak Majumdar
    • 2
  • Fernando Rosa-Velardo
    • 3
  1. 1.IMDEA Software InstituteMadridSpain
  2. 2.MPI-SWSKaiserslauternGermany
  3. 3.Universidad Complutense de MadridMadridSpain

Personalised recommendations