Actors: a model of concurrent computation in Distributed Systems Amin Saremi Hamid Mohamadi.

Slides:



Advertisements
Similar presentations
COMMUNICATING SEQUENTIAL PROCESSES C. A. R. Hoare The Queen’s University Belfast, North Ireland.
Advertisements

Parallel Processing & Parallel Algorithm May 8, 2003 B4 Yuuki Horita.
Programming Languages and Paradigms
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Structured Thread Models Kahn Process Networks, CSP, Go 1Dennis Kafura – CS5204 – Operating Systems.
/ PSWLAB Efficient Decentralized Monitoring of Safety in Distributed System K Sen, A Vardhan, G Agha, G Rosu 20 th July 2007 Presented by.
Session 18 Modeling the Dynamic View: The Collaboration Diagram Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 20, 2011 Presented.
1/25 Concurrency and asynchronous computing How do we deal with evaluation when we have a bunch of processors involved?
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
CS 582 / CMPE 481 Distributed Systems
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Concurrency CS 510: Programming Languages David Walker.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
CSCI 4550/8556 Computer Networks Comer, Chapter 19: Binding Protocol Addresses (ARP)
Models of Computation for Embedded System Design Alvise Bonivento.
Sequence Diagram. What is Sequence Diagram?  Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified.
A Customizable k-Anonymity Model for Protecting Location Privacy Written by: B. Gedik, L.Liu Presented by: Tal Shoseyov.
Fundamentals of Python: From First Programs Through Data Structures
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Scala Actors -Terrance Dsilva.  Thankfully, Scala offers a reasonable, flexible approach to concurrency  Actors aren’t a concept unique to Scala.
Computer Architecture Lecture 08 Fasih ur Rehman.
CEN Network Fundamentals Chapter 19 Binding Protocol Addresses (ARP) To insert your company logo on this slide From the Insert Menu Select “Picture”
1 CSC103: Introduction to Computer and Programming Lecture No 13.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
Chapter 15 DHCP. Dynamic Host Configuration Protocol An Application Layer Protocol A client server protocol that automatically provides an IP host with.
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
CS6133 Software Specification and Verification
Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 6: Organizing Information.
Chapter 19 - Binding Protocol Addresses
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 7: BPEL Some notes selected from.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Internet Security CSCE 813 Communicating Sequential Processes.
Object Oriented Analysis and Design Sequence Diagrams.
Chapter 22 Bootstrap and Auto configuration (DHCP) History of Bootstrap -Bootstrap is used to assign IP address to the computer. -Constant changes in the.
Variables, Environments and Closures. Overview Touch on the notions of variable extent and scope Introduce the notions of lexical scope and dynamic.
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
ACTORS. Motivation Develop language for concurrency “ Parallel Execution of actions ”.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
1 Seminar on SOA Seminar on Service Oriented Architecture BPEL Some notes selected from “Business Process Execution Language for Web Services” by Matjaz.
Operational Semantics of Scheme
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
Scaling the Network Chapters 3-4 Part 2
2.10 Flow and Error Control Before that ...
Objective: ARP.
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
Stacks and Queues.
Introduction to Compilers Tim Teitelbaum
Processes Chapter 3.
Object Oriented Programming
Sequence Diagrams Getting the Message.
Use Cases Based on the paper
Processes Chapter 3.
Processes Chapter 3.
Ch 17 - Binding Protocol Addresses
Lecture 12 Input/Output (programmer view)
Presentation transcript:

Actors: a model of concurrent computation in Distributed Systems Amin Saremi Hamid Mohamadi

General Design Decisions The nature of computing system –Sequential processes: sequential in nature but can execute in parallel with each other: concurrent Pascal, CSP, shared variable Transformation on states, state: map from location to value –Function transforming data values Example: dataflow, network of parallel process Indeterminate applicative system: call-by-value is used, result is a single value

–Actors: map each incoming communication to a 3-tuple: –Finite set of communication to other actors –A new behavior –Finite set of new actors created Behavior = history sensitive There is no presumed sequentiality in the action of actors Powerful computational agent than before: possible to specify arbitrary SP by actor system and not vice versa –Actors may create other actors but CSP don’t create other CSP

Global synchrony and asynchrony Interaction between agents –Shared variables –Communication Synchronous: sender & receiver ready, Hoare’s CSP, Minler’s CCS Asynchronous: receiver doesn't have to be ready, actor model, dataflow Any model of synch is built on asynch Synch communication is a special case of buffered asynch communication –“busy waiting” & recursive computation

Computation In Actor Systems Computation in a system of actors is carried out in response to communication sent to the system, communication are contained in task. All task that have already been processed may be removed The Configuration of an actor system: actors it contains and unprocessed tasks.

Tasks –Tag for distinguishing –Target: mail address –Communication: information to the actor at the target Behavior –Actors are said to accept a communication when they process a task –Accepting & replacement behavior An actor: –Mail address, mail queue –Behavior, function of the communication accepted

Xn Xn+1 Y1 task 12 nn+1... Create tasks Specifies replacement Create actors 1...

Target communication [k1] [k2] Create tasks Create actors Life-lines diagram

Programming with actors Behavior definition –Each time an actor accepts a communication it computes a replacement behavior, … –Behavior definition is expressed as a function of the incoming communication –Two list of identifiers used in a behavior definition Value for the first list must be specified when the actor is created: acquaintance list Gets its binding from an incoming communication: communication list

Creating actors –new expression which return the mail address – ::= new ({expr {, expr}*}) –Address of new actor can bind to identifier using –Actors created concurrently by an actor may know each other’s mail address, and all the newly created actor knows is the mail address of the other actor Creating tasks –A task is created by specifying a target and a communication – ::= send to

Declaring receptionists –The receptionists are the only actors that are free to receive communication from outside the system –Set of receptionist my also be changing –Whenever a communication containing the mail address is sent to an actor outside the system, the actor at that mail address become a receptionist Declaring external actors –Declare a sequence of identifiers as external  actors whose behavior is to buffer the communications Commands –Purpose: specify actions that are to be carried out –Command to specify a replacement behavior: become

forwarder: example of behavior –Has one acquaintance, the actor to whom the communication must be forwarded Conditional command –if-then –case

Examples Stack a stack-node with acquaintance content and link if operation requested is a pop & content NIL then become forwarder to link send content to customer if operation requested is push then let P = new stack-node with current acquaintances {become stack-node with acquaintances new- content and P}

Factorial Rec-factorial with acquaintances self let communication be an integer n and a customer u become Rec-factorial if n = 0 then send [1] to customer else let c = Rec-customer with acquaintance n and u {send [n-1, the mail address of c] to self} Rec-customer with acquaintances an integer n and a customer u let communication be an integer k {send [n*k] to u}

[1] [2] [6] [3,c] [2,m] [1,m’] [0,m’’] (m,(3,c)) (m’,(2,m)) (m’’,(1,m’))

External actors –Hold –Respond to a communication telling it to forward buffer with acquaintances content and link if operation requested is release & content NIL then send content to customer send release request with customer to link become forwarder to customer if operation requested is hold then let B be a new buffer with acquaintances content and link {become new buffer with acquaintance new-content and B}

Static Topology Function apply receptionists m1 m2 configuration m

def two-inputs-needed (m1,m2,m) [sender, arg] if sender = m1 then become one-input-needed (m1,m2,second,arg) else become one-input-needed (m1,m2,first,arg) fi end def def one-input-needed (m1,m2,m,new-arg-position, old-arg) [sender, new-arg] let k = (if new-arg-positio = second then f(old-arg, new-arg) else f(new-arg, old-arg) fi ) {send [k] to m} send ready to m1 send ready to m2 become two-inputs-needed (m1,m2) end def

Dynamic topology Call expression: Call g[k] input f g k reply

customerrequest f g

S’ let x= (call g[k]) {S} S’’ Factorial def exp rec-factorai() [n] become rec-factorial() if n = 0 then reply[1] else reply [n * (call self [n-1])] fi end def

Insensitive actors Checking-acc (balance, my-saving) [request] if (deposit request) then become send (receipt) to customer if (show-balance request) then send [balance] to customer if (withdrawal request) then if balance >= withdrawal-amount then become send [receipt] to customer else let b= new buffer and p= overdraft-proc (customer, self, my-savings, balance) {become insens-acc (b,p) send [withdrawal request with customer p] to my savings} Insense-acc (buffer, proxy) [request, sender] if request = become & sender = proxy then become else send to buffer

overdraft-proc (customer, my-checking,my-savings,checking-balance) [saving-response] send [savings-response] to customer if then send [become, checking-acc (0, my-savings)] to my checking else send [become, checking-acc (checking-balance, my-savings)] to my checking

Checking-acc Savings-acc request reply become hold release buffer Overdraft-proc

References [1]. G A. Agha, “ACRTORS: A Model of Concurrent Computation in Distributed Systems”, The MIT Press, 1986.