Understandable and Scalable Concurrency Christopher Brooks Programmer/Analyst, University of California, Berkeley Edward A. Lee Robert S. Pepper Distinguished.

Slides:



Advertisements
Similar presentations
A component- and message-based architectural style for GUI software
Advertisements

Software Architecture Frameworks A Family of Implementations Nikunj Mehta Computer Science Department University of Southern California Los Angeles, CA.
Architecture Representation
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Topic 2: Balance between formal and informal methods, engineering and artistry, evolution and rebuild Edward A. Lee Professor UC Berkeley Center for Hybrid.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Introduction To System Analysis and Design
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Process-Based Software Components for Networked Embedded Systems Edward A. Lee, PI UC Berkeley Core Technical Team (Mobies, SEC, and GSRC): Christopher.
Component Technologies for Embedded Systems Johan Eker.
Chess Review May 8, 2003 Berkeley, CA Classes and Inheritance in Actor- Oriented Models Stephen Neuendorffer Edward Lee UC Berkeley.
Advanced Tool Architectures Supporting Interface-Based Design
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Behavioral Types for Actor-Oriented Design Edward A. Lee.
Behavioral Types as Interface Definitions for Concurrent Components Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley.
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
Chess Review October 4, 2006 Alexandria, VA Edited and presented by Advanced Tool Architectures Edward A. Lee UC Berkeley.
Is Truly Real-Time Computing Becoming Unachievable? Edward A. Lee Robert S. Pepper Distinguished Professor and Chair of EECS, UC Berkeley Keynote Talk.
Heterogeneous Modeling and Design in Ptolemy II Johan Eker UC Berkeley with material courtesy of Edward Lee and the Ptolemy group ECE Seminar Series, Carnegie.
6th Biennial Ptolemy Miniconference Berkeley, CA May 12, 2005 Ptolemy Project Status and Overview Edward A. Lee Ptolemy Project Director, UC Berkeley.
February 12, 2009 Center for Hybrid and Embedded Software Systems Encapsulated Model Transformation Rule A transformation.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
Actor-Oriented Design: A focus on domain-specific languages for embedded systems Edward A. Lee Professor, UC Berkeley Director, Center for Hybrid and Embedded.
Unified Modeling (Part I) Overview of UML & Modeling
Building Unreliable Systems out of Reliable Components: The Real Time Story Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS CHESS: Center.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Cyber-Physical Systems: A Vision of the Future Edward A. Lee Robert S. Pepper Distinguished.
Understandable Concurrency Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS Director, CHESS: Center for Hybrid and Embedded Software Systems.
NSF Foundations of Hybrid and Embedded Software Systems UC Berkeley: Chess Vanderbilt University: ISIS University of Memphis: MSI A New System Science.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley System-Level Types for Component-Based Design Edward A.
Department of Electrical Engineering and Computer Sciences University of California at Berkeley Concurrent Component Patterns, Models of Computation, and.
February 12, 2009 Center for Hybrid and Embedded Software Systems Model Transformation Using ERG Controller Thomas H. Feng.
Demystifying Architectural Styles Nikunj Mehta 3/11/02Demystifying Architectural Styles2 Architectural Styles Characterize –Structure, i.e. external.
State of the Art Lecture IEEE Instrumentation and Measurement Technology Conference Budapest, Hungary, May 21-23, 2001 Computing for Embedded Systems Edward.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Ptolemy Project Vision Edward A. Lee Robert S. Pepper Distinguished Professor and Chair.
Embedded Software: Leveraging Concurrent Models of Computation Edward A. Lee Professor, UC Berkeley Center for Hybrid and Embedded Software Systems (CHESS)
5 th Biennial Ptolemy Miniconference Berkeley, CA, May 9, 2003 The Component Interaction Domain: Modeling Event-Driven and Demand- Driven Applications.
Embedded Software Challenges for the Next 10 Years Chess: Center for Hybrid and Embedded Software Systems Infineon Embedded Software Days Munich, Sept.
Panel: What Comes After C++ in System-Level Specification Edward Lee UC Berkeley Forum on Design Languages Workshop on System Specification & Design Languages.
Model-Driven Development From Object-Oriented Design to Actor-Oriented Design Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor.
Models of Computation as Program Transformations Chris Chang
Department of Electrical Engineering and Computer Sciences University of California at Berkeley The Ptolemy II Framework for Visual Languages Xiaojun Liu.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Composing Models of Computation in Kepler/Ptolemy II
An Introduction to Software Architecture
Assessing the Suitability of UML for Modeling Software Architectures Nenad Medvidovic Computer Science Department University of Southern California Los.
Introduction To System Analysis and Design
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Design Languages in 2010 Chess: Center for Hybrid and Embedded Software Systems Edward A. Lee Professor UC Berkeley Panel Position Statement Forum on Design.
Actor Networks Edward A. Lee Robert S. Pepper Distinguished Professor Chair of EECS UC Berkeley Invited Talk Workshop Foundations and Applications of Component-based.
1 "Workshop 31: Developing a Hands-on Undergraduate Parallel Programming Course with Pattern Programming SIGCSE The 44 th ACM Technical Symposium.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Actor Oriented Programming with CAL -designing embedded system components Johan Eker Department of Automatic Control, Lund University Chris Chang, Jörn.
Making Concurrency Mainstream Edward A. Lee Professor, Chair of EECS UC Berkeley Joint Invited Talk CONCUR: Concurrency Theory & FMICS: Formal Methods.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
The Future of Embedded Software Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS UC Berkeley ARTEMIS 2006 Annual Conference Graz, Austria.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Concurrency Demands New Foundations for Computing
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Retargetable Model-Based Code Generation in Ptolemy II
Is Truly Real-Time Computing Becoming Unachievable?
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
An Introduction to Software Architecture
Presentation transcript:

Understandable and Scalable Concurrency Christopher Brooks Programmer/Analyst, University of California, Berkeley Edward A. Lee Robert S. Pepper Distinguished Professor, Chair, Department of Electrical Engineering and Computer Sciences, University of California, Berkeley Citris/HP Labs meeting, Palo Alto January 16, 2007

Brooks, Lee, Berkeley 2Understandable and Scalable Concurrency Introductions Edward Lee would like to be here, but had a resource contention problem. I’m a software release engineer, training electrical engineers in the art of software engineering. I’ve worked with Edward since 1992, first on Ptolemy Classic (C++) and now on Ptolemy II (Java).

Brooks, Lee, Berkeley 3Understandable and Scalable Concurrency Concurrency in Software Practice, As of 2007 Threads Shared memory, semaphores, mutexes, monitors… Message Passing Synchronous, asynchronous, buffered, … Everything else, regrettably, remains largely in the domain of research…

Brooks, Lee, Berkeley 4Understandable and Scalable Concurrency The Buzz “Multicore architectures will (finally) bring parallel computing into the mainstream. To effectively exploit them, legions of programmers must emphasize concurrency.” The vendor push: “Please train your computer science students to do extensive multithreaded programming.”

Brooks, Lee, Berkeley 5Understandable and Scalable Concurrency Is this a good idea?

Brooks, Lee, Berkeley 6Understandable and Scalable Concurrency The Problem with Threads IEEE Computer, May 2006 article “For concurrent programming to become mainstream,... we must discard threads as a programming model”. “Nondeterminism should be judiciously and carefully introduced when needed,... and it should be explicit in programs.”

Brooks, Lee, Berkeley 7Understandable and Scalable Concurrency Edward Lee’s Claim Nontrivial software written with threads, semaphores, and mutexes are incomprehensible to humans and cannot and should not be trusted!

Brooks, Lee, Berkeley 8Understandable and Scalable Concurrency What it Feels Like When I Use the synchronized Keyword in Java

Brooks, Lee, Berkeley 9Understandable and Scalable Concurrency Why should HP care about concurrency? If a multicore machine with an HP logo crashes, then people will not blame Intel or AMD. First, they will blame Microsoft. Then, they will blame HP.

Brooks, Lee, Berkeley 10Understandable and Scalable Concurrency The Following are Only Partial Solutions Training programmers to use threads. Improve software engineering processes. Devote attention to “non-functional” properties. Use design patterns. None of these deliver a rigorous, analyzable, and understandable model of concurrency.

Brooks, Lee, Berkeley 11Understandable and Scalable Concurrency Succinct Problem Statement Threads are wildly nondeterministic. The programmer’s job is to prune away the nondeterminism by imposing constraints on execution order (e.g., mutexes) and limiting shared data accesses (e.g., OO design).

Brooks, Lee, Berkeley 12Understandable and Scalable Concurrency (Semi) Succinct Solution Statement Instead of starting with a wildly nondeterministic mechanism and asking the programmer to rein in that nondeterminism, start with a deterministic mechanism by using deterministic, composable components and incrementally add nondeterminism where needed. Under this principle, even the most effective of today’s techniques (OO design, transactions, message passing, …) require fundamental rethinking.

Brooks, Lee, Berkeley 13Understandable and Scalable Concurrency Our rethinking: Actor Oriented Programming Languages Concurrent Coordination Languages Higher order components

Brooks, Lee, Berkeley 14Understandable and Scalable Concurrency The First (?) Actor-Oriented Programming Language The On-Line Graphical Specification of Computer Procedures W. R. Sutherland, Ph.D. Thesis, MIT, 1966 MIT Lincoln Labs TX-2 Computer Bert Sutherland with a light pen Partially constructed actor-oriented model with a class definition (top) and instance (below). Bert Sutherland used the first acknowledged object- oriented framework (Sketchpad, created by his brother, Ivan Sutherland) to create the first actor-oriented programming language (which had a visual syntax).

Brooks, Lee, Berkeley 15Understandable and Scalable Concurrency Examples of Actor-Oriented “Languages” CORBA event service (distributed push-pull) ROOM and UML-2 (dataflow, Rational, IBM) VHDL, Verilog (discrete events, Cadence, Synopsys,...) LabVIEW (structured dataflow, National Instruments) Modelica (continuous-time, constraint-based, Linkoping) OPNET (discrete events, Opnet Technologies) SDL (process networks) Occam (rendezvous) Simulink (Continuous-time, The MathWorks) SPW (synchronous dataflow, Cadence, CoWare) … Many of these are domain specific. Many of these have visual syntaxes.

Brooks, Lee, Berkeley 16Understandable and Scalable Concurrency Ptolemy II: A Laboratory for Actor- Oriented Models of Computation Director from an extensible library defines component interaction semantics or “model of computation.” Extensible, behaviorally- polymorphic component library. Visual editor supporting an abstract syntax Type system for transported data Concurrency management supporting dynamic model structure.

Brooks, Lee, Berkeley 17Understandable and Scalable Concurrency Observer Pattern using an Actor-Oriented Language with Rendezvous Semantics Each actor is a process, communication is via rendezvous, and the Merge explicitly represents nondeterministic multi-way rendezvous. This is realized here in a coordination language with a visual syntax.

Brooks, Lee, Berkeley 18Understandable and Scalable Concurrency Now that we’ve made a trivial design pattern trivial, we can work on more interesting aspects of the design. E.g., suppose we don’t care how long notification of the observer is deferred, as long as the observer is notified of all changes in the right order?

Brooks, Lee, Berkeley 19Understandable and Scalable Concurrency Observer Pattern using an Actor-Oriented Language with Kahn Semantics (Extended with Nondeterministic Merge) Each actor is a process, communication is via streams, and the NondeterministicMerge explicitly merges streams nondeterministically. Again a coordination language with a visual syntax.

Brooks, Lee, Berkeley 20Understandable and Scalable Concurrency Suppose further that we want to explicitly specify the timing of producers?

Brooks, Lee, Berkeley 21Understandable and Scalable Concurrency Observer Pattern using an Actor-Oriented Language with Discrete Event Semantics Messages have a (semantic) time, and actors react to messages chronologically. Merge now becomes deterministic. Again a coordination language with a visual syntax.

Brooks, Lee, Berkeley 22Understandable and Scalable Concurrency Coordination Languages Coordination Languages don’t have syntax for mundane operations like arithmetic expressions (unlike Erlang and Ada). Coordination languages have been around for awhile (Papadopoulos & Arbab, 1998) Failed because they are not general purpose, one cannot write a compiler in them, adherents to Coordination Languages are traitors.

Brooks, Lee, Berkeley 23Understandable and Scalable Concurrency Concurrent Coordination Languages We propose to develop concurrent coordination languages based on sound, composable formalisms.

Brooks, Lee, Berkeley 24Understandable and Scalable Concurrency Scalability The key to composition languages are configurations with higher-order parameters These parameters enable reuse They also enable small descriptions of big systems Credit: Adam Cataldo

Brooks, Lee, Berkeley 25Understandable and Scalable Concurrency Examples of Higher-Order Components Google: MapReduce VHDL: Recursive Structures Bluespec System Verilog: Parameterization Dataflow: Higher-Order Systems Petri-nets: Higher-Order Tokens Liberty Simulation Environment: Higher-Order Parameters Credit: Adam Cataldo

Brooks, Lee, Berkeley 26Understandable and Scalable Concurrency Coordination languages can help with Scalability System is { Matrix(Component(2),20,3); } Component is { param n; port in[n*2+1]; port out[n*2+2]; } in { Blue(n, in[1..n*2], out[1..n*2]); Green(n, in[n*2+1], out[n*2+1]); } Credit: Adam Cataldo

Brooks, Lee, Berkeley 27Understandable and Scalable Concurrency Scalability: Ptalon Ptalon (Cataldo, Cheong, Feng, Mihal, Lee) “We seek a generic language for describing higher-order configurations” Ptalon VHDL Ptolemy SystemC Simulink Credit: Adam Cataldo

Brooks, Lee, Berkeley 28Understandable and Scalable Concurrency The Solution Actor-oriented component architectures implemented in coordination languages that complement rather than replace existing languages. With good design of these coordination languages, this will deliver understandable concurrency. See the Ptolemy Project for explorations of several such languages:

Brooks, Lee, Berkeley 29Understandable and Scalable Concurrency Time Line and Management Plan Year 1: Use Ptolemy II to create coordination languages with existing domains. Teach a graduate course in concurrency Year 2: Codification of useful higher-order components Develop visual syntax for higher-order comps. Year 3: Demonstrate combining coordination langs. Code Generator for concurrent programs Introduce undergrads to coordination langs.

Brooks, Lee, Berkeley 30Understandable and Scalable Concurrency Conclusion Transformation of bits is the foundation of computation. Threads are the foundation of concurrent programming practice. The foundations are flawed. Threads discard the most essential features of computation. Threads are incomprehensible to humans. They appeal because they make (almost) no changes to syntax. Concurrent computation needs a new foundation. Actor oriented component models. Coordination languages with actor semantics. Visual syntaxes to seduce users. These have a chance of acceptance!