Programming Paradigms for Concurrency Pavol Cerny Vasu Singh Thomas Wies Part III – Message Passing Concurrency.

Slides:



Advertisements
Similar presentations
Synthesis of Protocol Converter Using Timed Petri-Nets Anh Dang Balaji Krishnamoorthy Manoj Iyer Presented by:
Advertisements

Parallel Processing & Parallel Algorithm May 8, 2003 B4 Yuuki Horita.
Formal Semantics of Programming Languages 虞慧群 Topic 6: Advanced Issues.
Network Protocols Dr. Eng Amr T. Abdel-Hamid NETW 703 Winter 2006 Finite State Machines (FSMs)
Concurrency: introduction1 ©Magee/Kramer 2 nd Edition Concurrency State Models and Java Programs Jeff Magee and Jeff Kramer.
Programming Paradigms for Concurrency Lecture 11 Part III – Message Passing Concurrency TexPoint fonts used in EMF. Read the TexPoint manual before you.
Safe Programming of Asynchronous Interaction: Can we do it for real? Shaz Qadeer Research in Software Engineering Microsoft Research.
01/05/2015 Agay Spring School, March'02 Mobility 1 : the Pi Calculus Cédric Fournet Microsoft Research Cambridge.
/ PSWLAB Efficient Decentralized Monitoring of Safety in Distributed System K Sen, A Vardhan, G Agha, G Rosu 20 th July 2007 Presented by.
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
Actor-based Programming for Scalable Concurrent Systems Gul Agha
Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
CS 584. A Parallel Programming Model We need abstractions to make it simple. The programming model needs to fit our parallel machine model. Abstractions.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
Multiprocessors Andreas Klappenecker CPSC321 Computer Architecture.
Concurrency CS 510: Programming Languages David Walker.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
AR vs. CFSM Abdallah Tabbara. CFSM Overview 4 CFSM has: –a finite state machine part –a data computation part –a locally synchronous behavior transitions.
1 Ivan Lanese Computer Science Department University of Bologna Italy Evolvable systems: some ideas for modelling With input from Davide Sangiorgi, Fabrizio.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
Models of Computation for Embedded System Design Alvise Bonivento.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
Mobile Ambients Luca Cardelli Digital Equipment Corporation, Systems Research Center Andrew D. Gordon University of Cambridge, Computer Laboratory Presented.
Real-Time System Requirements & Design Specs Shaw - Chapters 3 & 4 Homework #2: 3.3.1, 3.4.1, Add Error states to Fig 4.1 Lecture 4/17.
Programming Paradigms for Concurrency Lecture 9 Part III – Message Passing Concurrency.
Scala Actors -Terrance Dsilva.  Thankfully, Scala offers a reasonable, flexible approach to concurrency  Actors aren’t a concept unique to Scala.
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
SDS Foil no 1 How to make real systems: Implementation design, deployment and realisation.
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2005/6 Universität Dortmund Some general properties of languages 1. Synchronous vs. asynchronous languages.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
Programming Paradigms for Concurrency Part 2: Transactional Memories Vasu Singh
Extreme Makeover for EDA Industry
Rebecca Modeling Language Mahdieh Ahmadi Verification of Reactive Systems March 2014.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Scientific Computing By: Fatima Hallak To: Dr. Guy Tel-Zur.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
Programming Paradigms for Concurrency Lecture 10 Part III – Message Passing Concurrency.
Advanced Topics in SE Spring Process Algebra Hossein Hojjat Formal Methods Lab University of Tehran.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Amending Choreographies Joint work with Fabrizio Montesi and Gianluigi Zavattaro.
Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications 1.
J-O-Caml (6) pauillac.inria.fr/~levy/qinghua/j-o-caml Qinghua, December 4.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
CS- 492 : Distributed system & Parallel Processing Lecture 7: Sun: 15/5/1435 Foundations of designing parallel algorithms and shared memory models Lecturer/
Modelling Reactive Systems 4 Professor Muffy Calder Dept. of Computing Science University of Glasgow
Functional Programming IN NON-FUNCTIONAL LANGUAGES.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Developing a Framework for Simulation, Verification and Testing of SDL Specifications Olga Shumsky Lawrence Henschen Northwestern University
A Theory of Distributed Objects Toward a Foundation for Component Grid Platforms Ludovic HENRIO l A Theory of Distributed Objects l Components l Perspectives.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Agenda  Quick Review  Finish Introduction  Java Threads.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
Parallel Programming Models EECC 756 David D. McGann 18 May, 1999.
Development of concurrent and distributed programs with the Actor model and Akka César Aguilera Padilla Thematic CERN School of Computing Split, 27th of.
Last Class: Introduction
2. Specification and Modeling
New trends in parallel computing
Transactional Memory Semaphores, monitors, and conditional critical regions all suffer from limitations based on lock semantics Naïve synchronization may.
CSP-Style Rendezvous Communication Thomas Feng, Edward Lee, Yang Zhao
Typically for using the shared memory the processes should:
Presentation transcript:

Programming Paradigms for Concurrency Pavol Cerny Vasu Singh Thomas Wies Part III – Message Passing Concurrency

The Downsides of Classical Shared Memory Concurrency shared memory typically implies physically shared memory locks: the “goto statements” of concurrency OS threads are resource-hungry and context-switching is expensive number of threads = number of available cores ≠ number of logical tasks number of threads = number of available cores ≠ number of logical tasks no natural adaptation to distributed settings reasoning about programs is (even more) difficult

Overview of Part III 1.Message Passing Programming Paradigms  actors (Scala)  first-class synchronous events (Concurrent ML) 2.MP Programming Techniques – client/server programming – process networks 3.Formal Semantics of MP Programs – process calculi 4.Formal Reasoning about MP Programs  behavioral equivalences  verifying safety and liveness properties

Actors object-oriented approach to concurrency “actor = object + logical thread” [Hewitt, Bishop, Steiger 1973, Agha 1986]

Actors actors perform local computations and communicate via MP communication is – asynchronous – buffered (in practice FIFO) – over unique-receiver channels (mailboxes) computation is – even-driven: react to incoming messages – dynamically create other actors – send messages to other actors – dynamically change behavior languages supporting actor-based concurrency – Erlang – Salsa – Scala – many implementations in form of libraries A A A A B B

Example: Ping-Pong Actors Ping Pong pong PingMsg

Example: Ping-Pong Actors Ping Pong pong PingMsg sender PongMsg

Example: Concurrent Merge Sort Sorter 1 523

Example: Concurrent Merge Sort Sorter

Example: Concurrent Merge Sort Sorter

Example: Concurrent Merge Sort Sorter

Example: Concurrent Merge Sort Sorter

Example: Concurrent Merge Sort Sorter

Example: Concurrent Merge Sort Sorter

CCS - A Process Calculus P,Q ::= 0 | A(a 1,…,a n ) | ¿.P | a?P | a!P | P “|” Q | P + Q | ( º a) P terminated process process identifier internal action input action output action parallel composition choice channel restriction

CCS - A Process Calculus Processes are defined by systems of recursive equations Ping(ping, pong)= Msg(ping) | (pong ? Ping(ping, pong)) Formal semantics given in terms of labeled transition systems ) enables formal reasoning about MP programs Diverge() = ¿.Diverge() Diverge() ´ ( º ping, pong) ((Ping(ping, pong) | Pong (ping, pong))) Pong(ping, pong) = ping ? (Msg(pong) | Pong (ping, pong)) Msg(a) = a ! 0

Project Proposals 1.Performance/Conciseness Evaluation of Concurrent Programming Paradigms Compare idiomatic implementations of the same algorithm in Scala using different programming paradigms: – a sequential implementation – a concurrent implementation based on actors – a concurrent implementation based on shared memory

Project Proposals 2.First-Class Synchronous Events in Scala – Take inspiration from the Scala Actor Library and the CML library – Implement a Scala library supporting first-class synchronous events.

Project Proposals 3.Verification of Scala Actor Programs –Implement a non-trivial Scala Actor program or take an existing one –Manually compute finite-state abstractions of all actors –Verify properties of the abstracted program using a formal verification tool for MP programs Please drop by or send me an to discuss concrete projects!