ACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING. Sander Sõnajalg



Similar documents
Scala Actors Library. Robert Hilbrich

IMCM: A Flexible Fine-Grained Adaptive Framework for Parallel Mobile Hybrid Cloud Applications

Efficient Monitoring in Actor-based Mobile Hybrid Cloud Framework. Kirill Mechitov, Reza Shiftehfar, and Gul Agha

Real Time Programming: Concepts

Ubiquitous access Inherently distributed Many, diverse clients (single purpose rich) Unlimited computation and data on demand

Developer support in a federated Platform-as-a-Service environment

Unit 8: Immutability & Actors

Mutual Exclusion using Monitors

Chapter 6, The Operating System Machine Level

Ruby's Newest Actor: Abrid Programming Concurrency Models

Tier Architectures. Kathleen Durant CS 3200

Why Threads Are A Bad Idea (for most purposes)

Streaming Data, Concurrency And R

Responsive, resilient, elastic and message driven system

Above the Clouds: Introducing Akka

Dell One Identity Manager Scalability and Performance

GUI and Web Programming

Monitoring Hadoop with Akka. Clint Combs Senior Software Engineer at Collective

Performance Monitoring and Analysis System for MUSCLE-based Applications

The Importance of Software License Server Monitoring

for my computation? Stefano Cozzini Which infrastructure Which infrastructure Democrito and SISSA/eLAB - Trieste

Chapter 6 Concurrent Programming

Cloud Computing. Chapter 8 Virtualization

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

A closer look at HP LoadRunner software

CS550. Distributed Operating Systems (Advanced Operating Systems) Instructor: Xian-He Sun

COMMMUNICATING COOPERATING PROCESSES

Networks and Services

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc.

INDIVIDUAL RESEARCH PAPER

REACTIVE systems [1] currently lie on the final frontier

Understanding Hardware Transactional Memory

Comparison of Concurrency Frameworks for the Java Virtual Machine

Data sharing in the Big Data era

Learning More About Load Testing

Foundations for your. portable cloud

CS423 Spring 2015 MP4: Dynamic Load Balancer Due April 27 th at 9:00 am 2015

LSKA 2010 Survey Report Job Scheduler

ELECTRONIC HEALTH RECORDS

Cloud Technologies in Mobile Core Networks. Mobile Cloud Networking workshop , Rui Gomes, Vodafone Portugal

Guideline for stresstest Page 1 of 6. Stress test

Web Server Software Architectures

A PERFORMANCE ANALYSIS of HADOOP CLUSTERS in OPENSTACK CLOUD and in REAL SYSTEM

A Middleware Strategy to Survive Compute Peak Loads in Cloud

In Memory Accelerator for MongoDB

SSC - Concurrency and Multi-threading Java multithreading programming - Synchronisation (I)

Write a technical report Present your results Write a workshop/conference paper (optional) Could be a real system, simulation and/or theoretical

Performance Analysis of Lucene Index on HBase Environment

Introducing Tetra: An Educational Parallel Programming System

.NET and J2EE Intro to Software Engineering

Scaling Up & Out with Actors: Introducing Akka

A distributed system is defined as

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Ambient-oriented Programming & AmbientTalk

EMX-2500 DATA SHEET FEATURES GIGABIT ETHERNET REMOTE CONTROLLER FOR PXI EXPRESS MAINFRAMES SYSTEM LEVEL FUNCTIONALITY

Cloud Computing Capacity Planning. Maximizing Cloud Value. Authors: Jose Vargas, Clint Sherwood. Organization: IBM Cloud Labs

A Fast Inter-Kernel Communication and Synchronization Layer for MetalSVM

Configuration Management for Distributed Development

ANDROID BASED MOBILE APPLICATION DEVELOPMENT and its SECURITY

1. Simulation of load balancing in a cloud computing environment using OMNET

Scaling Analysis Services in the Cloud

Last Class: Semaphores

Software design (Cont.)

ArcGIS for Server: Administrative Scripting and Automation

Storage Architectures for Big Data in the Cloud

ROCKING THE CLOUD VDI AT SAINT PAUL COLLEGE. Najam Saeed Lisa Nguyen Rob Reiter

Web Application Development Process

Designing for Maintainability

Contents. Preface Acknowledgements. Chapter 1 Introduction 1.1

Parametric Analysis of Mobile Cloud Computing using Simulation Modeling

Parallel Computing. Shared memory parallel programming with OpenMP

Operating Systems and Networks

Frysk The Systems Monitoring and Debugging Tool. Andrew Cagney

Thesis Proposal: Improving the Performance of Synchronization in Concurrent Haskell

It's all about business performance

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Optimizing High-Performance Trading Solutions: An Engineering Perspective

Making Sense of the Numbers DOs and DON'Ts of Quality Performance Testing

DISTRIBUTED SYSTEMS [COMP9243] Lecture 9a: Cloud Computing WHAT IS CLOUD COMPUTING? 2

2/9/2010. Standard Approach to Distribution. Remote Procedure Calls (RPC) Example: Music Jukebox in the Cloud

Manjrasoft Market Oriented Cloud Computing Platform

MANUFACTURING ERP SOFTWARE BUYERS GUIDE

Client/Server Computing Distributed Processing, Client/Server, and Clusters

Triplestore Testing in the Cloud with Clojure. Ryan Senior

NetWrix Server Configuration Monitor

Open Source DBMS CUBRID 2008 & Community Activities. Byung Joo Chung bjchung@cubrid.com

Lecture 1 Introduction to Android

Distributed Systems Lecture 1 1

A Fine-Grained Adaptive Middleware Framework for Parallel Mobile Hybrid Cloud Applications

Cloud Computing. Karan Saxena * & Kritika Agarwal**

TYPESAFE TOGETHER - SUBSCRIBER TRAINING. Training Classes

White Paper Design Sharing in BIM. Design Sharing in BIM

The Double-layer Master-Slave Model : A Hybrid Approach to Parallel Programming for Multicore Clusters

How To Understand The Concept Of A Distributed System

The Oracle Universal Server Buffer Manager

Scaling Out With Apache Spark. DTL Meeting Slides based on

Disk Storage Shortfall

REAL-TIME STREAMING ANALYTICS DATA IN, ACTION OUT

Parallel Computing: Strategies and Implications. Dori Exterman CTO IncrediBuild.

WSO2 Message Broker. Scalable persistent Messaging System

Transcription:

ACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING Sander Sõnajalg

Contents Introduction to concurrent programming Shared-memory model vs. actor model Main principles of the actor model Actors for light-weight processes Actors for distributed programming Importance & perspectives of actor model

Concurrent programming = when programs are designed as collection of interacting computational processes that may be executed in parallel (Wikipedia) Inter-dependant processes executing simultaneously affecting each-other's work must exchange information to do so

Concurrent programming: motivation Concurrency in local computer Let part of a local program do something useful in the background while it is waiting for some input Clients need to be served in parallel (web server) Parallelizing things for distributing Distributing for inclusion of new resource Distributing because functional requirements demand it

Implementing Concurrent Programming GOAL: Implement a library which would provide necessary abstractions on top of operating system resources to simplify concurrent programming What we need? Units that could be executed in parallel (concurrency primitives) Means of communication between these units

The Traditional Way: Threads & Shared Memory Smallest executable unit is thread Usually, operating system threads are used Virtual threading is possible, but less common ( green threads ) Communication is implemented by sharing variables

Threads & Shared Memory thread 1 thread 2 T1 T2 go to sleep, wait for x from T1 Aqcuire lock for slot 5, write value of x check if T1 has written x fail; go back to sleep x 1 2 3 4 5 6 7 8 9... shared memory read value of x time

The Traditional Way: Threads & Shared Memory Pros: Fast Cons: Complicated & error-prone client code Not extendable to distributed programming Threads are heavy-weight not too scalable Examples: Standard concurrency libraries in Java, C#, etc..

The OTHER Way: The Actor Model Smallest executable unit is an actor An actor is a concurrency primitive that does not share any resources with other actors Communication is implemented by actors sending each-other messages

Actors: formal definition Actors are computational agents which map each incoming communication to a triple consisting of: A finite set of communications sent to other actors A new behavior (which will govern the response to the next communication processed) A finite set of new actors created (Gul A. Agha, 1985)

Workflow: event-driven + asynchronous initial system start c1 A1 A2 create message x c2 create message y A3 c3 x message z y time z

Actors and event-driven programming Rather than explicitly sleeping or waking up, actors react to the events events = interactions with other actors = messages Actors get passive when they've finished their previous tasks and nobody has sent them new messages of interest Passive actors activate immediately when somebody has sent them an interesting message

Asynchronous message passing Message sending is asynchronous Each actor has a mailbox for storing messages that are not consumed immediately. If message arrives when actor is busy working on a previous message, it gets stored in it's mailbox If actor arrives at a point where it waits new messages to continue, it first looks through it's mailbox. Messages of unsuitable type are ignored First suitable message allows actor to continue

Asynchronous message passing: Example of message receiving.. receive { case Approve() =>.. case Cancel() =>.. }.. CASE A contents of mailbox Answer(7) Cancel() CASE B contents of mailbox Approve() newest Blaa() Answer(7) Blaa() newest

An example X Y class Counter extends Actor { override def run: unit = loop(0) value=0 C } def loop(value: int): unit = { Console.println("Value: " + value) receive { case Incr() => loop(value + 1) case Value(p) => p! value loop(value) case _ => loop(value) } } value=1 Incr() Value(X) 1 time

Actors for light-weight processes Thread-based concurrency usually directly mapped to operating system threads 1 code-level thread = 1 operating system thread Operating system threads are expensive! Most actor-based concurrency libraries don't map actors directly to operating system threads ( light-weight actors ) 1 operating system thread = 1 active actor + unlimited amount of inactive actors

Actors in distributed programming The actor model naturally extends from concurrency inside one computer to concurrency in a distributed network of computers Local and remote actors look the same The concurrency framework will deal with the technical details: message-passing over the network message serialization actor identificators management network connection management

The Actor model Pros: Event-driven approach is more intuitive Directly and transparently applicable for distributed programming Implements light-weight processes => better scaling Cons: Message-passing is slower Libraries and solutions not yet as mature (e.g. no good frameworks for Java before 2008)

Actor model implementations Separate concurrency languages Erlang SALSA Frameworks Scala Actor Framework for Scala Kilim, FunctionalJava for Java Kamaelia, Eventlet, PARLEY for Python Dramatis, Revactor for Ruby

Current importance & perspectives Cuncurrency in today's middleware almost always thread-based Hardware evolves towards more parallel architectures IT-industry evolves towards workforce being more costly than hardware In 2008, actor frameworks exist for all popular programming languages Cloud computing (thin clients, etc.)