Compiling the pi-calculus into a Multithreaded Typed Assembly Language

We extend a previous work on a multithreaded typed assembly language (MIL) targeted at shared memory multiprocessors, and describe the design of a type-preserving compiler from the @p-calculus into MIL. The language enforces a policy on lock usage through a typing system that also ensures race-freedom for typable programs, while allowing for typing various important concurrency patterns. Our translation to MIL generates code that is then linked to a library supporting a generic unbounded buffer monitor, variant of Hoare's bounded buffer monitor, entirely written in MIL. Such a monitor shields client code (the @p-calculus compiler in particular) from the hazardous task of direct lock manipulation, while allowing for the representation of @p-calculus channels. The compiler produces type correct MIL programs from type correct source code, generating low-contention cooperative multithreaded programs.

[1]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[2]  Raheel Ahmad,et al.  The π-Calculus: A theory of mobile processes , 2008, Scalable Comput. Pract. Exp..

[3]  Dan Grossman,et al.  TALx86: A Realistic Typed Assembly Language∗ , 1999 .

[4]  Cédric Fournet,et al.  The reflexive CHAM and the join-calculus , 1996, POPL '96.

[5]  Vasco T. Vasconcelos,et al.  A Virtual Machine for the TyCO Process Calculus , 1999 .

[6]  David N. Turner,et al.  The polymorphic Pi-calculus : theory and implementation , 1996 .

[7]  Martin Rinard,et al.  A Type System for Preventing Data Races and Deadlocks in Java Programs , 2002 .

[8]  Kunle Olukotun,et al.  The Future of Microprocessors , 2005, ACM Queue.

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

[10]  Cosimo Laneve,et al.  A type system for JVM threads , 2003, Theor. Comput. Sci..

[11]  Hubert Garavel,et al.  Reflections on the Future of Concurrency Theory in General and Process Calculi in Particular , 2008, LIX.

[12]  Jozef Gruska Foundations of Computing , 1997 .

[13]  Martin C. Rinard,et al.  ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), November 2002 Ownership Types for Safe Programming: Preventing Data Races and Deadlocks , 2022 .

[14]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[15]  Fernando M. A. Silva,et al.  Fine Grained Multithreading with Process Calculi , 2000, IEEE Trans. Computers.

[16]  Mario Tokoro,et al.  An Object Calculus for Asynchronous Communication , 1991, ECOOP.

[17]  Akinori Yonezawa,et al.  An Efficient Compilation Framework for Languages Based on a Concurrent Process Calculus , 1997, Euro-Par.

[18]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

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

[20]  G. Erard Boudol Asynchrony and the -calculus (note) , 1992 .

[21]  Martín Abadi,et al.  Types for Safe Locking , 1999, ESOP.

[22]  Benjamin C. Pierce,et al.  Pict: a programming language based on the Pi-Calculus , 2000, Proof, Language, and Interaction.

[23]  Stephen N. Freund,et al.  Type inference against races , 2007, Sci. Comput. Program..

[24]  F. Martins,et al.  Controlling Security Policies in a Distributed Environment , 2004 .

[25]  Hervé Paulino,et al.  A Multi-threaded Asynchronous Language , 2003, PaCT.

[26]  Jr. Guy L. Steele,et al.  Rabbit: A Compiler for Scheme , 1978 .

[27]  Futoshi Iwama,et al.  A New Type System for JVM Lock Primitives , 2002, ASIA-PEPM '02.

[28]  Tiago Soares Cogumbreiro Garcia COMPILING THE pi-CALCULUS INTO A MULTITHREADED TYPED ASSEMBLY LANGUAGE , 2009 .

[29]  Vasco T. Vasconcelos A Multithreaded Typed Assembly Language , 2006 .

[30]  Martín Abadi,et al.  Object Types against Races , 1999, CONCUR.

[31]  Andrew D. Birrell,et al.  An Introduction to Programming with Threads , 1996 .

[32]  Robin Milner,et al.  The Polyadic π-Calculus: a Tutorial , 1993 .

[33]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[34]  Axel Uhl,et al.  Model-Driven Architecture , 2002, OOIS Workshops.

[35]  Davide Sangiorgi,et al.  The Pi-Calculus - a theory of mobile processes , 2001 .

[36]  Davide Sangiorgi,et al.  Communicating and Mobile Systems: the π-calculus, , 2000 .

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

[38]  Louis-Julien Guillemette A type-preserving compiler from system f to typed assembly language , 2009 .

[39]  C. A. R. Hoare,et al.  Monitors: an operating system structuring concept , 1974, CACM.

[40]  Jean-Yves Girard,et al.  The System F of Variable Types, Fifteen Years Later , 1986, Theor. Comput. Sci..

[41]  Simon Peyton Jones,et al.  Featherweight concurrency in a portable assembly language , 2001 .

[42]  Wei-Ngan Chin,et al.  Proceedings of the ASIAN symposium on Partial evaluation and semantics-based program manipulation , 2002 .

[43]  Francisco Martins,et al.  Type Inference for Deadlock Detection in a Multithreaded Polymorphic Typed Assembly Language , 2009, PLACES.

[44]  Stuart Kent,et al.  Model Driven Engineering , 2002, IFM.

[45]  Tony Hoare,et al.  Hierarchical Program Structures , 1972 .

[46]  S. Schwartz,et al.  Properties of the working-set model , 1972, OPSR.

[47]  Xinyu Feng,et al.  Modular verification of concurrent assembly code with dynamic thread creation and termination , 2005, ICFP '05.

[48]  Fernando M. A. Silva,et al.  A Virtual Machine for a Process Calculus , 1999, PPDP.

[49]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .