Concurrency by modularity: design patterns, a case in point

General purpose object-oriented programs typically aren't embarrassingly parallel. For these applications, finding enough concurrency remains a challenge in program design. To address this challenge, in the Panini project we are looking at reconciling concurrent program design goals with modular program design goals. The main idea is that if programmers improve the modularity of their programs they should get concurrency for free. In this work we describe one of our directions to reconcile these two goals by enhancing Gang-of-Four (GOF) object-oriented design patterns. GOF patterns are commonly used to improve the modularity of object-oriented software. These patterns describe strategies to decouple components in design space and specify how these components should interact. Our hypothesis is that if these patterns are enhanced to also decouple components in execution space applying them will concomitantly improve the design and potentially available concurrency in software systems. To evaluate our hypothesis we have studied all 23 GOF patterns. For 18 patterns out of 23, our hypothesis has held true. Another interesting preliminary result reported here is that for 17 out of these 18 studied patterns, concurrency and synchronization concerns were completely encapsulated in our concurrent design pattern framework.

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

[2]  Keshav Pingali,et al.  Optimistic parallelism requires abstractions , 2007, PLDI '07.

[3]  Luca Cardelli,et al.  Modern concurrency abstractions for C# , 2002, TOPL.

[4]  John K. Ousterhout,et al.  Why Threads Are A Bad Idea (for most purposes) , 2003 .

[5]  Eddie Kohler,et al.  Events Can Make Sense , 2007, USENIX Annual Technical Conference.

[6]  Timothy G. Mattson,et al.  Patterns for parallel programming , 2004 .

[7]  Vasant Honavar,et al.  Aligning Biomolecular Networks Using Modular Graph Kernels , 2009, WABI.

[8]  Klaus-Peter Löhr,et al.  Object-Oriented Concurrent Programming , 1992, TOOLS.

[9]  Michael D. Ernst,et al.  Refactoring sequential Java code for concurrency via concurrent libraries , 2009, 2009 IEEE 31st International Conference on Software Engineering.

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

[11]  Monica S. Lam,et al.  The design, implementation, and evaluation of Jade , 1998, TOPL.

[12]  Bratin Saha,et al.  McRT-STM: a high performance software transactional memory system for a multi-core runtime , 2006, PPoPP '06.

[13]  Doug Lea Concurrent Programming in Java. Second Edition: Design Principles and Patterns , 1999 .

[14]  Bruce D. Shriver,et al.  Research Directions in Object-Oriented Programming , 1987 .

[15]  Rupak Majumdar,et al.  Tasks: language support for event-driven programming , 2007, PEPM '07.

[16]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[17]  Pierre America,et al.  Issues in the design of a parallel object-oriented language , 1989, Formal Aspects of Computing.

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

[19]  Gregor Kiczales,et al.  D: A Language Framework for Distributed Programming , 1997 .

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

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

[22]  Sebastian Burckhardt,et al.  The design of a task parallel library , 2009, OOPSLA.

[23]  Timothy G. Mattson,et al.  A Pat-tern Language for Parallel Programming , 2004 .

[24]  Michael McCool,et al.  Structured parallel programming with deterministic patterns , 2010 .

[25]  Polyvios Pratikakis,et al.  Transparent proxies for java futures , 2004, OOPSLA.

[26]  Doug Lea,et al.  A Java fork/join framework , 2000, JAVA '00.

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

[28]  Doug Lea,et al.  Concurrent Programming In Java , 1996 .

[29]  Robert H. Halstead,et al.  MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.

[30]  Walter F. Tichy,et al.  Software engineering for multicore systems: an experience report , 2008, IWMSE '08.

[31]  Hridesh Rajan,et al.  Implicit invocation meets safe, implicit concurrency , 2010, GPCE '10.

[32]  Matteo Frigo,et al.  The implementation of the Cilk-5 multithreaded language , 1998, PLDI.