Message Passing. Advanced Operating Systems Tutorial 7

Similar documents
Message Passing. Advanced Operating Systems Tutorial 5

Concurrent & Distributed Systems Supervision Exercises

Erlang. Joe Armstrong.

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Erlang. Joe Armstrong

Reminder from last time

Introduction to Concurrent Software Systems. CSCI 5828: Foundations of Software Engineering Lecture 08 09/17/2015

Introduction to Concurrent Software Systems. CSCI 5828: Foundations of Software Engineering Lecture 12 09/29/2016

It turns out that races can be eliminated without sacrificing much in terms of performance or expressive power.

Erlang 101. Google Doc

Erlang and Go (CS262a, Berkeley Fall 2016) Philipp Moritz

The Actor Model applied to the Raspberry Pi and the Embedded Domain. The Erlang Embedded Project. Omer

POSIX Threads: a first step toward parallel programming. George Bosilca

CSE544 Database Architecture

The Actor Model applied to the Raspberry Pi and the Embedded Domain. Omer

Programming Language Impact on the Development of Distributed Systems

Erlang. Types, Abstract Form & Core. Salvador Tamarit Muñoz. Universitat Politècnica de València

Akka: Simpler Concurrency, Scalability & Fault-tolerance through Actors. Jonas Bonér Viktor Klang

The do s and don ts of error handling. Joe Armstrong

Concurrency: what, why, how

Discussion CSE 224. Week 4

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections

Functional Programming In Real Life

Object Oriented Paradigm

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads.

Concurrency in Object Oriented Programs 1. Object-Oriented Software Development COMP4001 CSE UNSW Sydney Lecturer: John Potter

Structure of Programming Languages Lecture 10

Programming Paradigms

Introduction to Locks. Intrinsic Locks

Persistent Data Structures and Managed References

Grand Central Dispatch and NSOperation. CSCI 5828: Foundations of Software Engineering Lecture 28 12/03/2015

CS 2112 Lecture 20 Synchronization 5 April 2012 Lecturer: Andrew Myers

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Swift 5, ABI Stability and

Capriccio: Scalable Threads for Internet Services

Introduction to programming with semaphores Fri 1 Sep 2017

Parley: Federated Virtual Machines

Speculative Parallelization Technology s only constant is CHANGE. Devarshi Ghoshal Sreesudhan

Distributed Systems. Big Topic: Synchronization. Lec 6: Local Synchronization Primitives. Slide acks: Jinyang Li, Dave Andersen, Randy Bryant

Francesco Cesarini. Concurrency + Distribution = Availability + Scalability.

Shared Mutable State SWEN-220

An Introduction to Erlang

All you need is fun. Cons T Åhs Keeper of The Code

Lecture 7: Data Abstractions

Objects as Session-Typed Processes

Tackling Concurrency With STM. Mark Volkmann 10/22/09

Tackling Concurrency With STM

What are the characteristics of Object Oriented programming language?

Identity, State and Values

Kotlin/Native concurrency model. nikolay

Introduction to Concurrency Principles of Concurrent System Design

Allocating memory in a lock-free manner

On Object Orientation as a Paradigm for General Purpose. Distributed Operating Systems

Operating Systems : Overview

VALLIAMMAI ENGINEERING COLLEGE

Concurrent systems Lecture 1: Introduction to concurrency, threads, and mutual exclusion

A Transactional Model and Platform for Designing and Implementing Reactive Systems

Luerl - an implementation of Lua on the Erlang VM

CMSC 330: Organization of Programming Languages. Functional Programming with OCaml

Concurrency: a crash course

Aaron Turon! Mozilla Research

CoBoxes: Distributed Heaps with Cooperative Tasks

Multicore and Multiprocessor Systems: Part I

Unit Testing in Java with an Emphasis on Concurrency Corky Cartwright Rice and Halmstad Universities Summer 2013

Welcome to. Instructor Marc Pomplun CS 470/670. Introduction to Artificial Intelligence 1/26/2016. Spring Selectivity in Complex Scenes

Lecture 16: Recapitulations. Lecture 16: Recapitulations p. 1

Erlang and Concurrency. André Pang Rising Sun Research

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Topics in Object-Oriented Design Patterns

Programming Languages (PL)

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Kumar Bhuyan School of Science and Technology

Reminder from last time

Embedded System Design and Modeling EE382N.23, Fall 2017

CS527 Software Security

Database Management Systems

The Analysis and Design of the Object-oriented System Li Xin 1, a

[module 2.2] MODELING CONCURRENT PROGRAM EXECUTION

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

A Parallel Programming Primer. by Alan G. Labouseur

High-Level Small-Step Operational Semantics for Software Transactions

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

Systems software design. Processes, threads and operating system resources

Systems I: Programming Abstractions

The Actor Model. Towards Better Concurrency. By: Dror Bereznitsky

Classes and Inheritance in Actor- Oriented Models

JVM ByteCode Interpreter

CS313T ADVANCED PROGRAMMING LANGUAGE

Favoring Isolated Mutability The Actor Model of Concurrency. CSCI 5828: Foundations of Software Engineering Lecture 24 04/11/2012

MultiThreading. Object Orientated Programming in Java. Benjamin Kenwright

Concurrency: what, why, how

CS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation

Fault Tolerance. o Basic Concepts o Process Resilience o Reliable Client-Server Communication o Reliable Group Communication. o Distributed Commit


1: Introduction to Object (1)

GFS: The Google File System

Functional Programming. Ionut G. Stan - OpenAgile 2010

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

CS370 Operating Systems Midterm Review

An Introduction to Erlang

Dynamic Race Detection with LLVM Compiler

Transcription:

Message Passing Advanced Operating Systems Tutorial 7

Tutorial Outline Review of Lectured Material Discussion: Erlang and message passing 2

Review of Lectured Material Message passing systems Limitations of threads and lock-based concurrency Multicore memory models; composition of lock-based code Concepts of message passing systems Interaction models; communication and the type system; naming communications Message handling; immutability; linear types; use of an exchange heap Pattern matching and state machines Error handling; let-it-crash philosophy; supervision hierarchies; case study Erlang and Scala+Akka as examples 3

Key Points Understand the concepts of actor-based message passing programming languages and systems Reflect on the suitability of message passing as a concurrency primitive for future systems Advantages and disadvantages compared to lock-based concurrency with shared mutable state 4

Discussion contributed articles BY JOE ARMSTRONG Erlang ERLANG IS A concurrent programming language designed for programming fault-tolerant distributed systems at Ericsson and has been (since 2000) freely available subject to an open-source license. More recently, we ve seen renewed interest in Erlang, as the Erlang way of programming maps naturally to multicore computers. In it the notion of a process is fundamental, with processes created and managed by the Erlang runtime system, not by the underlying operating system. The individual processes, which are programmed in a simple dynamically typed functional programming language, do not share memory and exchange data through message passing, simplifying the programming of multicore computers. Erlang 2 is used for programming fault-tolerant, distributed, real-time applications. What differentiates it from most other languages is that it s a concurrent programming language; concurrency belongs to the language, not to the operating system. Its programs are collections of parallel processes cooperating to solve a particular problem that can be created quickly and have only limited memory 68 COMMUNICATIONS OF THE ACM SEPTEMBER 2010 VOL. 53 NO. 9 DOI:10.1145/1810891.1810910 The same component isolation that made it effective for large distributed telecom systems makes it effective for multicore CPUs and networked applications. overhead; programmers can create large numbers of Erlang processes yet ignore any preconceived ideas they might have about limiting the number of processes in their solutions. All Erlang processes are isolated from one another and in principle are thread safe. When Erlang applications are deployed on multicore computers, the individual Erlang processes are spread over the cores, and programmers do not have to worry about the details. The isolated processes share no data, and polymorphic messages can be sent between processes. In supporting strong isolation between processes and polymorphism, Erlang could be viewed as extremely object-oriented though without the usual mechanisms associated with traditional OO languages. Erlang has no mutexes, and processes cannot share memory. a Even within a process, data is immutable. The sequential Erlang subset that executes within an individual process is a dynamically typed functional programming language with immutable state. b Moreover, instead of classes, methods, and inheritance, Erlang has modules that contain functions, as well as higher-order functions. It also includes processes, sophisticated error handling, code-replacement mechanisms, and a large set of libraries. Here, I outline the key design criteria behind the language, showing how they are reflected in the language itself, as well as in programming language technology used since 1985. Shared Nothing The Erlang story began in mid-1985 when I was a new employee at the Ericsson Computer Science Lab in Stocka The shared memory is hidden from the programmer. Practically all application programmers never use primitives that manipulate shared memory; the primitives are intended for writing special system processes and not normally exposed to the programmer. b This is not strictly true; processes can mutate local data, though such mutation is discouraged and rarely necessary. J. Armstrong, Erlang, Communications of the ACM, 53(9), Sept. 2010, DOI: 10.1145/1810891.1810910 Does the programming model make sense? Purely functional with immutable data Software isolated processes (i.e., actors) with message passing and no shared mutable state Syntax and type system Relation to Singularity? Independent of Erlang, is the message passing approach a good alternative to the threads-and-locks model of concurrency? Are problems with race conditions, deadlock, etc., solved? Does the reliability model ( let it crash ) make sense? Move error handling to a separate process Replication and fault tolerance at the process level Do you believe in independent failures of software processes? Is dynamic typing required to enable upgrade of running systems? 5