Chapter Seven - Event-Based Concurrency: Applications, Abstractions, and Analyses

Abstract Due to the increased emphasis on responsiveness, event-based design has become mainstream in software development. Software applications are required to maintain responsiveness even while performing multiple tasks simultaneously. This has resulted in the adoption of a combination of thread and event-based concurrency in modern software such as smartphone applications. In this chapter, we present the fundamental programming and semantic concepts in the combined concurrency model of threads and events. The paradigm of event-based concurrency cuts across programming languages and application frameworks. We give a flavor of event-driven programming in a few languages and application frameworks. The mix of threads and events complicates reasoning about correctness of applications under all possible interleavings. We discuss advances in the core concurrency analysis techniques for event-driven applications with focus on happens-before analysis, race detection, and model checking. We also survey other analysis techniques and related programming abstractions.

[1]  Zvonimir Rakamaric,et al.  Delay-bounded scheduling , 2011, POPL '11.

[2]  Scott A. Mahlke,et al.  Accelerating asynchronous programs through Event Sneak Peek , 2015, 2015 ACM/IEEE 42nd Annual International Symposium on Computer Architecture (ISCA).

[3]  Patrice Godefroid,et al.  Partial-Order Methods for the Verification of Concurrent Systems , 1996, Lecture Notes in Computer Science.

[4]  Axel Legay,et al.  TransDPOR: A Novel Dynamic Partial-Order Reduction Technique for Testing Actor Programs , 2012, FMOODS/FORTE.

[5]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[6]  Masumi Nakamura,et al.  Programming Android , 2011 .

[7]  Frank Tip,et al.  Repairing Event Race Errors by Controlling Nondeterminism , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[8]  Rupak Majumdar,et al.  Analysis of Asynchronous Programs with Event-Based Synchronization , 2015, ESOP.

[9]  Alastair F. Donaldson,et al.  Asynchronous programming, analysis and testing with state machines , 2015, PLDI.

[10]  Porfirio Tramontana,et al.  Using GUI ripping for automated testing of Android applications , 2012, 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.

[11]  Klaus Havelund,et al.  Model Checking Programs , 2004, Automated Software Engineering.

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

[13]  Rupak Majumdar,et al.  Race detection for Android applications , 2014, PLDI.

[14]  Rupak Majumdar,et al.  Partial Order Reduction for Event-Driven Multi-threaded Programs , 2016, TACAS.

[15]  Patrice Godefroid,et al.  Dynamic partial-order reduction for model checking software , 2005, POPL '05.

[16]  Mayur Naik,et al.  Dynodroid: an input generation system for Android apps , 2013, ESEC/FSE 2013.

[17]  Manu Sridharan,et al.  Race detection for web applications , 2012, PLDI.

[18]  Ramesh Govindan,et al.  TOSThreads: thread-safe and non-invasive preemption in TinyOS , 2009, SenSys '09.

[19]  Martin T. Vechev,et al.  Scalable race detection for Android applications , 2015, OOPSLA.

[20]  Sam Blackshear,et al.  Selective control-flow abstraction via jumping , 2015, OOPSLA.

[21]  Yun Zhang,et al.  Static data race detection for concurrent programs with asynchronous calls , 2009, ESEC/FSE '09.

[22]  Manu Sridharan,et al.  Effective race detection for event-driven programs , 2013, OOPSLA.

[23]  Patrice Godefroid,et al.  Model checking for programming languages using VeriSoft , 1997, POPL '97.

[24]  Damien Zufferey,et al.  P: safe asynchronous event-driven programming , 2013, PLDI.

[25]  Yongjian Hu,et al.  Automatically verifying and reproducing event-based races in Android apps , 2016, ISSTA.

[26]  Serdar Tasiran,et al.  Verifying Robustness of Event-Driven Asynchronous Programs Against Concurrency , 2017, ESOP.

[27]  Pranav Garg,et al.  Natural proofs for asynchronous programs using almost-synchronous reductions , 2014, OOPSLA 2014.

[28]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.

[29]  Madan Musuvathi,et al.  Iterative context bounding for systematic testing of multithreaded programs , 2007, PLDI '07.

[30]  Rupak Majumdar,et al.  Algorithmic verification of asynchronous programs , 2010, TOPL.

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

[32]  Mike Cantelon,et al.  Node.js in Action , 2013 .

[33]  Edmund M. Clarke,et al.  State space reduction using partial order techniques , 1999, International Journal on Software Tools for Technology Transfer.

[34]  Ahmed Bouajjani,et al.  Bounded phase analysis of message-passing programs , 2012, International Journal on Software Tools for Technology Transfer.

[35]  Edmund M. Clarke,et al.  Model Checking , 1999, Handbook of Automated Reasoning.

[36]  Jasmin Christian Blanchette,et al.  C++ GUI programming with Qt 4 , 2004 .

[37]  Koushik Sen,et al.  Automated Systematic Testing of Open Distributed Programs , 2006, FASE.

[38]  Antoni W. Mazurkiewicz,et al.  Trace Theory , 1986, Advances in Petri Nets.

[39]  Dimitar Dimitrov,et al.  Stateless model checking of event-driven applications , 2015, OOPSLA.

[40]  Antti Valmari,et al.  Stubborn sets for reduced state space generation , 1991, Applications and Theory of Petri Nets.

[41]  Horatiu Jula,et al.  Platform-wide deadlock immunity for mobile phones , 2011, 2011 IEEE/IFIP 41st International Conference on Dependable Systems and Networks Workshops (DSN-W).

[42]  Satish Narayanasamy,et al.  AsyncClock: Scalable Inference of Asynchronous Event Causality , 2017, ASPLOS.

[43]  C.-H. Luke Ong,et al.  Automatic Verification of Erlang-Style Concurrency , 2013, SAS.

[44]  Aditya Kanade,et al.  Efficient computation of happens-before relation for event-driven programs , 2017, ISSTA.

[45]  Satish Narayanasamy,et al.  Race detection for event-driven mobile applications , 2014, PLDI.

[46]  Feng Zhao,et al.  TinyGALS: a programming model for event-driven embedded systems , 2003, SAC '03.

[47]  Colin J. Fidge,et al.  Timestamps in Message-Passing Systems That Preserve the Partial Ordering , 1988 .

[48]  George C. Necula,et al.  EventBreak , 2014, OOPSLA.

[49]  Aditya Kanade,et al.  Efficient race detection in the presence of programmatic event loops , 2016, ISSTA.

[50]  Aditya Kanade,et al.  Asynchrony-aware static analysis of Android applications , 2016, 2016 ACM/IEEE International Conference on Formal Methods and Models for System Design (MEMOCODE).

[51]  Darko Marinov,et al.  A Framework for State-Space Exploration of Java-Based Actor Programs , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[52]  H. V. Jagadish,et al.  A compression technique to materialize transitive closure , 1990, TODS.

[53]  Steve Souders Even Faster Web Sites - Performance Best Practices for Web Developers , 2009 .

[54]  Serdar Tasiran,et al.  Systematic Asynchrony Bug Exploration for Android Apps , 2015, CAV.

[55]  Arie van Deursen,et al.  A study and toolkit for asynchronous programming in c# , 2014, ICSE.

[56]  Étienne Payet,et al.  Static Analysis of Android Programs , 2011, CADE.

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

[58]  Doron A. Peled,et al.  All from One, One for All: on Model Checking Using Representatives , 1993, CAV.

[59]  Aditya Kanade,et al.  Static deadlock detection for asynchronous C# programs , 2017, PLDI.

[60]  Claudio V. Russo,et al.  Pause 'n' Play: Formalizing Asynchronous C# , 2012, ECOOP.

[61]  George C. Necula,et al.  Guided GUI testing of android apps with minimal restart and approximate learning , 2013, OOPSLA.

[62]  Rupak Majumdar,et al.  Rely/Guarantee Reasoning for Asynchronous Programs , 2015, CONCUR.

[63]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[64]  Alkis Gotovos,et al.  Systematic Testing for Detecting Concurrency Errors in Erlang Programs , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[65]  David E. Culler,et al.  SEDA: an architecture for well-conditioned, scalable internet services , 2001, SOSP.

[66]  Friedemann Mattern,et al.  Virtual Time and Global States of Distributed Systems , 2002 .