Efficient, deterministic and deadlock-free concurrency

Concurrent programming languages are growing in importance with the advent of multicore systems. Two major concerns in any concurrent program are data races and deadlocks. Each are potentially subtle bugs that can be caused by nondeterministic scheduling choices in most concurrent formalisms. Unfortunately, traditional race and deadlock detection techniques fail on both large programs, and small programs with complex behaviors. We believe the solution is model-based design, where the programmer is presented with a constrained higher-level language that prevents certain unwanted behavior. We present the SHIM model that guarantees the absence of data races by eschewing shared memory. This dissertation provides SHIM based techniques that aid determinism—models that guarantee determinism, compilers that generate deterministic code and libraries that provide deterministic constructs. Additionally, we avoid deadlocks, a consequence of improper synchronization. A SHIM program may deadlock if it violates a communication protocol. We provide efficient techniques for detecting and deterministically breaking deadlocks in programs that use the SHIM model. We evaluate the efficiency of our techniques with a set of benchmarks. We have also extended our ideas to other languages. The ultimate goal is to provide deterministic deadlock-free concurrency along with efficiency. Our hope is that these ideas will be used in the future while designing complex concurrent systems.

[1]  David F. Bacon,et al.  Guava: a dialect of Java without data races , 2000, OOPSLA '00.

[2]  Stephen L. Olivier,et al.  UTS: An Unbalanced Tree Search Benchmark , 2006, LCPC.

[3]  Klaus Havelund,et al.  Confirmation of deadlock potentials detected by runtime analysis , 2006, PADTAD '06.

[4]  Stephen A. Edwards,et al.  Ensuring deterministic concurrency through compilation , 2010, 2010 IEEE International Symposium on Parallel & Distributed Processing, Workshops and Phd Forum (IPDPSW).

[5]  Jürgen Teich,et al.  Buffer Memory Optimization in DSP Applications - An Evolutionary Approach , 1998, PPSN.

[6]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA 2009.

[7]  Bill Lin,et al.  Efficient compilation of process-based concurrent programs without run-time scheduling , 1998, Proceedings Design, Automation and Test in Europe.

[8]  Wolfram Schulte,et al.  The essence of data access in Cω: the power is in the dot! , 2005 .

[9]  N. Vasudevan D 2 C : Deterministic , Deadlock-free Concurrency , 2010 .

[10]  Stephen A. Edwards,et al.  Compile-Time Analysis and Specialization of Clocks in Concurrent Programs , 2009, CC.

[11]  Guang R. Gao,et al.  Minimizing Buffer Requirements under Rate-Optimal Schedule in Regular Dataflow Networks , 2002, J. VLSI Signal Process..

[12]  Gérard Berry,et al.  The Esterel Synchronous Programming Language: Design, Semantics, Implementation , 1992, Sci. Comput. Program..

[13]  Amir Pnueli,et al.  In Transition From Global to Modular Temporal Reasoning about Programs , 1989, Logics and Models of Concurrent Systems.

[14]  Phillip Stanley-Marbell,et al.  Adaptive Data Placement in an Embedded Multiprocessor Thread Library , 2006, Proceedings of the Design Automation & Test in Europe Conference.

[15]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA '09.

[16]  Stephen A. Edwards,et al.  Determinism Should Ensure Deadlock-Freedom , 2010 .

[17]  Edsger W. Dijkstra,et al.  Cooperating sequential processes , 2002 .

[18]  Gavin M. Bierman,et al.  The Essence of Data Access in Comega , 2005, European Conference on Object-Oriented Programming.

[19]  Fabrizio Petrini,et al.  Cell Multiprocessor Communication Network: Built for Speed , 2006, IEEE Micro.

[20]  Praveen K. Murthy,et al.  Memory Management for Synthesis of DSP Software , 2006 .

[21]  Michael Gschwind,et al.  Optimizing Compiler for the CELL Processor , 2005, 14th International Conference on Parallel Architectures and Compilation Techniques (PACT'05).

[22]  Marek Olszewski,et al.  Kendo: efficient deterministic multithreading in software , 2009, ASPLOS.

[23]  Rajeev Alur,et al.  Automatic symbolic compositional verification by learning assumptions , 2008, Formal Methods Syst. Des..

[24]  Gary L. Peterson,et al.  Myths About the Mutual Exclusion Problem , 1981, Inf. Process. Lett..

[25]  Stephen A. Edwards,et al.  R-SHIM: deterministic concurrency with recursion and shared variables , 2006, Fourth ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2006. MEMOCODE '06. Proceedings..

[26]  Flavio Lerda,et al.  Symbolic Model Checking of Software , 2003, SoftMC@CAV.

[27]  Bradley C. Kuszmaul,et al.  Cilk: an efficient multithreaded runtime system , 1995, PPOPP '95.

[28]  Praveen K. Murthy,et al.  Buffer merging—a powerful technique for reducing memory requirements of synchronous dataflow specifications , 2004, TODE.

[29]  Stephen A. Edwards,et al.  Efficient code generation from SHIM models , 2006, LCTES '06.

[30]  Joël Ouaknine,et al.  Automated Compositional Abstraction Refinement for Concurrent C Programs: A Two-Level Approach , 2003, SoftMC@CAV.

[31]  Bart Kienhuis,et al.  Interactive presentation: A process splitting transformation for Kahn process networks , 2007 .

[32]  Simon L. Peyton Jones,et al.  Lock Free Data Structures Using STM in Haskell , 2006, FLOPS.

[33]  Joseph Sifakis,et al.  Compositional Verification for Component-Based Systems and Application , 2008, ATVA.

[34]  John H. Reppy,et al.  Specialization of CML message-passing primitives , 2007, POPL '07.

[35]  S. Asano,et al.  The design and implementation of a first-generation CELL processor , 2005, ISSCC. 2005 IEEE International Digest of Technical Papers. Solid-State Circuits Conference, 2005..

[36]  Sen Hu,et al.  Efficient system-enforced deterministic parallelism , 2010, OSDI.

[37]  Jong-Deok Choi,et al.  Deterministic replay of Java multithreaded applications , 1998, SPDT '98.

[38]  Laura M. Haas,et al.  Distributed deadlock detection , 1983, TOCS.

[39]  Dan Grossman,et al.  CoreDet: a compiler and runtime system for deterministic multithreaded execution , 2010, ASPLOS 2010.

[40]  Vivek Sarkar,et al.  X10: concurrent programming for modern architectures , 2007, PPOPP.

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

[42]  Edmund M. Clarke,et al.  Counterexample-Guided Abstraction Refinement , 2000, CAV.

[43]  Gerard J. Holzmann,et al.  The Model Checker SPIN , 1997, IEEE Trans. Software Eng..

[44]  James C. Corbett,et al.  Evaluating Deadlock Detection Methods for Concurrent Software , 1996, IEEE Trans. Software Eng..

[45]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[46]  Joël Ouaknine,et al.  Automated, compositional and iterative deadlock detection , 2004, Proceedings. Second ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2004. MEMOCODE '04..

[47]  David Detlefs,et al.  Eliminating synchronization-related atomic operations with biased locking and bulk rebiasing , 2006, OOPSLA '06.

[48]  Stephen A. Edwards,et al.  Celling SHIM: compiling deterministic concurrency to a heterogeneous multicore , 2009, SAC '09.

[49]  Lionel Lacassagne,et al.  Parallelization schemes for memory optimization on the cell processor: a case study of image processing algorithm , 2007, MEDEA '07.

[50]  Praveen K. Murthy,et al.  Systematic consolidation of input and output buffers in synchronous dataflow specifications , 2000, 2000 IEEE Workshop on SiGNAL PROCESSING SYSTEMS. SiPS 2000. Design and Implementation (Cat. No.00TH8528).

[51]  Enno Scholz Four Concurrency Primitives for Haskell , 1995 .

[52]  Brandon Lucia,et al.  DMP: deterministic shared memory multiprocessing , 2009, IEEE Micro.

[53]  L.A. Smith,et al.  A Parallel Java Grande Benchmark Suite , 2001, ACM/IEEE SC 2001 Conference (SC'01).

[54]  Henry Hoffmann,et al.  StreamIt: A Compiler for Streaming Applications ⁄ , 2002 .

[55]  Tian Xia,et al.  A Compositional Method With Failure-Preserving Abstraction for Asynchronous Design Verification , 2008, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[56]  Enrico Malaguti,et al.  The Vertex Coloring Problem and its generalizations , 2009, 4OR.

[57]  Barbara G. Ryder,et al.  A model of Ada programs for static deadlock detection in polynomial times , 1991, PADD '91.

[58]  William Thies,et al.  StreamIt: A Language for Streaming Applications , 2002, CC.

[59]  Corina S. Pasareanu,et al.  Learning Assumptions for Compositional Verification , 2003, TACAS.

[60]  Philip S. Yu,et al.  CellSort: High Performance Sorting on the Cell Processor , 2007, VLDB.

[61]  Laurent Mounier,et al.  Compositional State Space Generation from Lotos Programs , 1997, TACAS.

[62]  Sagar Chaki,et al.  Assume-Guarantee Reasoning for Deadlock , 2006, 2006 Formal Methods in Computer Aided Design.

[63]  Myunghwan Kim,et al.  A distributed scheme for dynamic deadlock detection and resolution , 1992, Inf. Sci..

[64]  Stephen A. Edwards,et al.  Compositional deadlock detection for rendezvous communication , 2009, EMSOFT '09.

[65]  Stephen A. Edwards,et al.  Efficient code generation from SHIM models , 2006 .

[66]  Michael Gschwind,et al.  Using advanced compiler technology to exploit the performance of the Cell Broadband EngineTM architecture , 2006, IBM Syst. J..

[67]  Message Passing Interface Forum MPI: A message - passing interface standard , 1994 .

[68]  Laurent Mounier,et al.  Compositional State Space Generation with Partial Order Reductions for Asynchronous Communicating Systems , 2000, TACAS.

[69]  Charles E. Leiserson,et al.  Detecting data races in Cilk programs that use locks , 1998, SPAA '98.

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

[71]  Rüdiger Reinecke,et al.  Hoares Communicating Sequential Processes: Erweiterung des Spurenmodells , 1985 .

[72]  Stephen A. Edwards,et al.  Programming Shared Memory Multiprocessors with Deterministic Message-Passing Concurrency: Compiling SHIM to Pthreads , 2008, 2008 Design, Automation and Test in Europe.

[73]  Kiyokuni Kawachiya,et al.  Lock reservation: Java locks can mostly do without atomic operations , 2002, OOPSLA '02.

[74]  Marco Pistore,et al.  Nusmv version 2: an opensource tool for symbolic model checking , 2002, CAV 2002.

[75]  Mauricio J. Serrano,et al.  Thin locks: featherweight synchronization for Java , 1998, PLDI '98.

[76]  Koushik Sen,et al.  Asserting and checking determinism for multithreaded programs , 2009, ESEC/FSE '09.

[77]  William Thies,et al.  Cache aware optimization of stream programs , 2005, LCTES '05.

[78]  Emery D. Berger,et al.  Grace: safe multithreaded programming for C/C++ , 2009, OOPSLA 2009.

[79]  Ion Stoica,et al.  ODR: output-deterministic replay for multicore debugging , 2009, SOSP '09.

[80]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[81]  Stephen A. Edwards,et al.  Static elaboration of recursion for concurrent software , 2008, PEPM '08.

[82]  허윤정,et al.  Holzmann의 ˝The Model Checker SPIN˝에 대하여 , 1998 .

[83]  Edmund M. Clarke,et al.  Compositional model checking , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[84]  Hugo De Man,et al.  Array placement for storage size reduction in embedded multimedia systems , 1997, Proceedings IEEE International Conference on Application-Specific Systems, Architectures and Processors.

[85]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[86]  Stephen A. Edwards,et al.  Static Deadlock Detection for the SHIM Concurrent Language , 2008, 2008 6th ACM/IEEE International Conference on Formal Methods and Models for Co-Design.

[87]  Vivek Sarkar,et al.  May-happen-in-parallel analysis of X10 programs , 2007, PPoPP.

[88]  Stephen A. Edwards,et al.  Buffer Sharing in Rendezvous Programs , 2010, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[89]  Leslie Lamport,et al.  A fast mutual exclusion algorithm , 1987, TOCS.

[90]  Paul Roe,et al.  Parallel programming using functional languages , 1991 .

[91]  Praveen K. Murthy,et al.  Shared buffer implementations of signal processing systems usinglifetime analysis techniques , 2001, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[92]  Gilles Kahn,et al.  The Semantics of a Simple Language for Parallel Programming , 1974, IFIP Congress.

[93]  Sebastian Burckhardt,et al.  CheckFence: checking consistency of concurrent data types on relaxed memory models , 2007, PLDI '07.

[94]  Stephen A. Edwards,et al.  SHIM: a deterministic model for heterogeneous embedded systems , 2005, IEEE Transactions on Very Large Scale Integration (VLSI) Systems.

[95]  Vivek Sarkar,et al.  Automatic Verification of Determinism for Structured Parallel Programs , 2010, SAS.

[96]  Sarita V. Adve,et al.  Shared Memory Consistency Models: A Tutorial , 1996, Computer.

[97]  Vivek Sarkar,et al.  Type inference for locality analysis of distributed data structures , 2008, PPoPP.

[98]  Stephen A. Edwards,et al.  A Determinizing Compiler , 2009 .

[99]  Stephen A. Edwards,et al.  Compiling SHIM , 2010, Synthesis of Embedded Software.

[100]  Paolo Toth,et al.  Models and heuristic algorithms for a weighted vertex coloring problem , 2009, J. Heuristics.

[101]  Timothy Mark Pinkston,et al.  Characterizing the Cell EIB On-Chip Network , 2007, IEEE Micro.

[102]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[103]  Stephen A. Edwards,et al.  A deterministic multi-way rendezvous library for haskell , 2008, 2008 IEEE International Symposium on Parallel and Distributed Processing.

[104]  Marek Chrobak,et al.  The Buffer Minimization Problem for Multiprocessor Scheduling with Conflicts , 2001, ICALP.

[105]  Stephen A. Edwards,et al.  Scheduling-independent threads and exceptions in SHIM , 2006, EMSOFT '06.

[106]  Sander Stuijk,et al.  Minimising buffer requirements of synchronous dataflow graphs with model checking , 2005, Proceedings. 42nd Design Automation Conference, 2005..

[107]  Kiyokuni Kawachiya,et al.  Lock Reservation for Java Reconsidered , 2004, ECOOP.

[108]  Thomas A. Henzinger,et al.  Thread-Modular Abstraction Refinement , 2003, CAV.

[109]  Nicolas Mercouroff,et al.  An Algorithm for Analyzing Communicating Processes , 1991, MFPS.

[110]  George S. Avrunin,et al.  Breaking up is hard to do: An evaluation of automated assume-guarantee reasoning , 2008, TSEM.

[111]  Anoop Gupta,et al.  The SPLASH-2 programs: characterization and methodological considerations , 1995, ISCA.

[112]  H. Peter Hofstee,et al.  Introduction to the Cell multiprocessor , 2005, IBM J. Res. Dev..

[113]  Michael L. Scott,et al.  Algorithms for scalable synchronization on shared-memory multiprocessors , 1991, TOCS.

[114]  Simon L. Peyton Jones,et al.  Concurrent Haskell , 1996, POPL '96.

[115]  Vivek Sarkar,et al.  X10: an object-oriented approach to non-uniform cluster computing , 2005, OOPSLA '05.

[116]  Toshio Nakatani,et al.  MPI microtask for programming the Cell Broadband EngineTM processor , 2006, IBM Syst. J..

[117]  William H. Press,et al.  Numerical recipes in C , 2002 .

[118]  Fabrizio Petrini,et al.  Multicore Surprises: Lessons Learned from Optimizing Sweep3D on the Cell Broadband Engine , 2007, 2007 IEEE International Parallel and Distributed Processing Symposium.

[119]  Howard Barringer,et al.  Proof Rules for Automated Compositional Verification through Learning , 2003 .

[120]  E.A. Lee,et al.  Synchronous data flow , 1987, Proceedings of the IEEE.

[121]  Sarita V. Adve,et al.  Parallel programming must be deterministic by default , 2009 .

[122]  Sérgio Vale Aguiar Campos,et al.  Compositional Reasoning in Model Checking , 1997, COMPOS.

[123]  Stephen A. Edwards,et al.  Buffer sharing in CSP-like programs , 2009, 2009 7th IEEE/ACM International Conference on Formal Methods and Models for Co-Design.

[124]  Yosi Ben-Asher,et al.  Heuristics for finding concurrent bugs , 2003, Proceedings International Parallel and Distributed Processing Symposium.

[125]  Stephen A. Edwards,et al.  A JPEG Decoder in SHIM , 2006 .

[126]  Stephen A. Edwards,et al.  Simple and fast biased locks , 2010, 2010 19th International Conference on Parallel Architectures and Compilation Techniques (PACT).

[127]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2008, Commun. ACM.

[128]  P. Hanrahan,et al.  Sequoia: Programming the Memory Hierarchy , 2006, ACM/IEEE SC 2006 Conference (SC'06).

[129]  Stavros Tripakis,et al.  A memory-optimal buffering protocol for preservation of synchronous semantics under preemptive scheduling , 2006, EMSOFT '06.

[130]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[131]  Aart J. C. Bik,et al.  Practical Compiler Techniques on Efficient Multithreaded Code Generation for OpenMP Programs , 2005, Comput. J..