Order types: static reasoning about message races in asynchronous message passing concurrency

Asynchronous message passing concurrency with higher level concurrency constructs including activities, asynchronous method invocations and future return values is gaining increased popularity, as an alternative to shared memory concurrency with lower level threads and locks. However, similar to data races in shared memory concurrency, message races in asynchronous message passing concurrency can make a program incorrect and cause bugs that are hard to find and fix. This paper presents order types, a novel type system for static reasoning about message races in asynchronous message passing concurrency. Order types are local, causal and polymorphic types with the following features. First, order types encode both communication and flow behaviors and their happens-before relations. Second, order types are designed for an imperative calculus with concurrent activities, asynchronous method invocations, future return values, wait-by-necessity synchronizations on futures, first-class activities and futures, recursion and dynamic creation of activities. Third, order types are polymorphic and introduce universally quantified type variables to encode unknown values of variables. Fourth, the order type of a module can be inferred modularly using only its implementation and independent of implementations of other modules in the program. Order types complement previous work on static reasoning about races in asynchronous message passing concurrency.

[1]  Nobuko Yoshida,et al.  Session-Based Distributed Programming in Java , 2008, ECOOP.

[2]  Denis Caromel,et al.  Toward a method of object-oriented concurrent programming , 1993, CACM.

[3]  Lori A. Clarke,et al.  Data flow analysis for verifying properties of concurrent programs , 1994, SIGSOFT '94.

[4]  Flemming Nielson,et al.  Type and Effect Systems , 1999, Correct System Design.

[5]  Gul A. Agha,et al.  HAL: A High-Level Actor Language and Its Distributed Implementation , 1992, ICPP.

[6]  Alexander Aiken,et al.  Effective static race detection for Java , 2006, PLDI '06.

[7]  Sophia Drossopoulou,et al.  Session Types for Object-Oriented Languages , 2006, ECOOP.

[8]  Philip Wadler,et al.  Mixing Metaphors: Actors as Channels and Channels as Actors , 2016, ECOOP.

[9]  Carl Hewitt,et al.  Concurrent Programming Using Actors: Exploiting large-Scale Parallelism , 1985, FSTTCS.

[10]  G RyderBarbara,et al.  Parameterized object sensitivity for points-to analysis for Java , 2005 .

[11]  Silvia Crafa Behavioural Types for Actor Systems , 2012, ArXiv.

[12]  Vasco Thudichum Vasconcelos,et al.  Session Typing for a Featherweight Erlang , 2011, COORDINATION.

[13]  Martin C. Rinard,et al.  A parameterized type system for race-free Java programs , 2001, OOPSLA '01.

[14]  Yannis Smaragdakis,et al.  Sound predictive race detection in polynomial time , 2012, POPL '12.

[15]  Akinori Yonezawa,et al.  ABCL: an object-oriented concurrent system , 1990 .

[16]  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.

[17]  C. Tomlinson,et al.  Rosette: An object-oriented concurrent systems architecture , 1988, OOPSLA/ECOOP '88.

[18]  Benjamin C. Pierce,et al.  Linearity and the pi-calculus , 1999, TOPL.

[19]  Sagar Chaki,et al.  Types as models: model checking message-passing programs , 2002, POPL '02.

[20]  James R. Larus,et al.  Software and the Concurrency Revolution , 2005, ACM Queue.

[21]  Cosimo Laneve,et al.  A framework for deadlock detection in core ABS , 2015, Software & Systems Modeling.

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

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

[24]  Hridesh Rajan,et al.  On ordering problems in message passing software , 2016, MODULARITY.

[25]  Carroll Morgan Procedures, parameters, and abstraction: Separate concerns , 1988, Sci. Comput. Program..

[26]  Reiner Hähnle,et al.  ABS: A Core Language for Abstract Behavioral Specification , 2010, FMCO.

[27]  Hridesh Rajan,et al.  Panini: a concurrent programming model for solving pervasive and oblivious interference , 2015, MODULARITY.

[28]  Dan Grossman,et al.  Type-safe multithreading in cyclone , 2003, TLDI '03.

[29]  Nobuko Yoshida,et al.  Global Principal Typing in Partially Commutative Asynchronous Sessions , 2009, ESOP.

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

[31]  Stephen N. Freund,et al.  Type-based race detection for Java , 2000, PLDI '00.

[32]  Cosimo Laneve,et al.  Deadlock analysis of unbounded process networks , 2014, Inf. Comput..

[33]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[34]  Mehdi Bagherzadeh,et al.  Panini: a concurrent programming model with modular reasoning , 2015, SPLASH.

[35]  Atsushi Igarashi,et al.  A generic type system for the Pi-calculus , 2001, POPL '01.

[36]  Scott F. Smith,et al.  Task types for pervasive atomicity , 2010, OOPSLA.

[37]  Scott F. Smith,et al.  Precise Constraint-Based Type Inference for Java , 2001, ECOOP.

[38]  Suresh Jagannathan,et al.  Safe futures for Java , 2005, OOPSLA '05.

[39]  Barbara G. Ryder,et al.  Parameterized object sensitivity for points-to analysis for Java , 2005, TSEM.

[40]  Vasco Thudichum Vasconcelos,et al.  Language Primitives and Type Discipline for Structured Communication-Based Programming Revisited: Two Systems for Higher-Order Session Communication , 1998, SecReT@ICALP.

[41]  Arnd Poetzsch-Heffter,et al.  JCoBox: Generalizing Active Objects to Concurrent Components , 2010, ECOOP.

[42]  Denis Caromel,et al.  Asynchronous sequential processes , 2009, Inf. Comput..

[43]  Wooyoung Kim,et al.  THAL: An Actor System for Efficient and Scalable Concurrent Computing , 1997 .

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

[45]  Nobuko Yoshida,et al.  Multiparty asynchronous session types , 2008, POPL '08.

[46]  David Gay,et al.  Barrier inference , 1998, POPL '98.

[47]  Hridesh Rajan,et al.  Capsule-Oriented Programming , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[48]  Martín Abadi,et al.  Types for safe locking: Static race detection for Java , 2006, TOPL.

[49]  Ralph E. Johnson,et al.  Bita: Coverage-guided, automatic testing of actor programs , 2013, 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[50]  Sorin Lerner,et al.  RELAY: static race detection on millions of lines of code , 2007, ESEC-FSE '07.

[51]  Hridesh Rajan,et al.  Capsule-oriented Programming in the Panini Language , 2014 .

[52]  Rahul Agarwal,et al.  Type Inference for Parameterized Race-Free Java , 2004, VMCAI.

[53]  Nobuko Yoshida,et al.  Multiparty Session Actors , 2014 .