Actors for Reactive Programming. Actors Origins

Size: px
Start display at page:

Download "Actors for Reactive Programming. Actors Origins"

Transcription

1 Actors Origins Hewitt, early 1970s (1973 paper) Around the same time as Smalltalk Concurrency plus Scheme Agha, early 1980s (1986 book) Erlang (Ericsson), 1990s Akka, 2010s Munindar P. Singh (NCSU) Service-Oriented Computing Fall

2 Actors: Way of Thinking Key idea: support for autonomy Designed for concurrency Equally good for distribution Shared nothing Style of thinking Architecture: no longer a single locus of control and storage Programming: reacting to events propagated via messages Eschew states, visibility of internal information, synchronization primitives (locks) Forget threads as a programming abstraction threads may implicitly do the work but not to program them Messaging and no shared memory Resource management Start additional actors as needed for work and resources available Stop actors when not needed Migrate actors when needed, taking advantage of a universal actor reference Handle exceptions through monitoring and supervision Munindar P. Singh (NCSU) Service-Oriented Computing Fall

3 Actor Basics An actor Encapsulates local state (memory) hence, the state may not be directly accessed from outside an actor Encapsulates a thread Mailbox (incoming) Processed in order of arrival, though could be reordered (e.g., PriorityMailbox) ActorRef: globally unique ID (serializable) To create an actor class in Akka, Extend appropriate abstract class (or, in Scala, trait) Define a receive method Define corresponding Props configuration class Munindar P. Singh (NCSU) Service-Oriented Computing Fall

4 HelloAkkaJava.java (Messages) p u b l i c c l a s s H e l l o A k k a J a v a { //MPS: The f i r s t message i s G r e e t ; i t has no p a r a m e t e r s ; i t s // e x p e c t e d outcome i s to send a g r e e t i n g p u b l i c s t a t i c c l a s s G r e e t implements S e r i a l i z a b l e { //MPS: The second message i s WhoToGreet ; i t has one parameter, // t h e t a r g e t o f t h e g r e e t i n g ; i t s e x p e c t e d outcome i s f o r // t h e r e c i p i e n t to change t h e t a r g e t p u b l i c s t a t i c c l a s s WhoToGreet implements S e r i a l i z a b l e { p u b l i c f i n a l S t r i n g who ; p u b l i c WhoToGreet ( S t r i n g who ) { t h i s. who = who ; //MPS: The t h i r d message i s G r e e t i n g ; i t has one parameter, t h e // g r e e t i n g message ; i t i s a message to be s e n t p u b l i c s t a t i c c l a s s G r e e t i n g implements S e r i a l i z a b l e { p u b l i c f i n a l S t r i n g message ; p u b l i c G r e e t i n g ( S t r i n g message ) { t h i s. message = message ; Munindar P. Singh (NCSU) Service-Oriented Computing Fall

5 HelloAkkaJava.java (Actor) p u b l i c s t a t i c c l a s s G r e e t e r e x t e n d s A b s t r a c t A c t o r { S t r i n g g r e e t i n g = ; // i n t e r n a l s t a t e o f t h e a c t o O v e r r i d e //MPS: Mapping o f messages to b e h a v i o r s. This s n i p p e t // h a n d l e s t h e two incoming messages ; i t doesn t mention // t h e o u t g o i n g message ( G r e e t i n g ) p u b l i c R e c e i v e c r e a t e R e c e i v e ( ) { r e t u r n r e c e i v e B u i l d e r ( ). match ( WhoToGreet. c l a s s, t h i s : : onwhotogreet ). match ( G r e e t. c l a s s, t h i s : : ongreet ). b u i l d ( ) ; // MPS: Update i n t e r n a l s t a t e on r e c e i v i n g a WhoToGreet message p r i v a t e v o i d onwhotogreet ( WhoToGreet whotogreet ) { g r e e t i n g = h e l l o, + whotogreet. who ; // MPS: Send g r e e t i n g message on r e c e i v i n g a G r e e t message p r i v a t e v o i d ongreet ( G r e e t g r e e t ) { // Send t h e c u r r e n t g r e e t i n g back to t h e s e n d e r g e t S e n d e r ( ). t e l l ( new G r e e t i n g ( g r e e t i n g ), g e t S e l f ( ) ) ; Munindar P. Singh (NCSU) Service-Oriented Computing Fall

6 HelloAkkaJava.java (Main 1) p u b l i c s t a t i c v o i d main ( S t r i n g [ ] a r g s ) { t r y { // C r e a t e t h e h e l l o A k k a a c t o r system and t h e g r e e t e r a c t o r f i n a l ActorSystem system = ActorSystem. c r e a t e ( h e l l o A k k a ) ; f i n a l A c t o r R e f g r e e t e r = system. a c t o r O f ( Props. c r e a t e ( G r e e t e r. c l a s s ), g r e e t e r ) ; // MPS: The i n b o x ( a p p a r e n t misnomer ) f u n c t i o n s as an a c t o r to // communicate w i t h a c t o r s ; s o r t o f a main f o r a c t o r s to use // as a p l a c e f o r send and r e c e i v e f i n a l I n b o x i n b o x = I n b o x. c r e a t e ( system ) ; // T e l l t h e g r e e t e r to change i t s g r e e t i n g message g r e e t e r. t e l l ( new WhoToGreet ( akka ), A c t o r R e f. nosender ( ) ) ; // Ask f o r t h e c u r r e n t g r e e t i n g ; r e p l y to go to i n b o x i n b o x. send ( g r e e t e r, new G r e e t ( ) ) ; // Wait 5 s e c o n d s f o r t h e r e p l y w i t h t h e g r e e t i n g message f i n a l G r e e t i n g g r e e t i n g 1 = ( G r e e t i n g ) i n b o x. r e c e i v e ( D u r a t i o n. c r e a t e ( 5, TimeUnit. SECONDS) ) ; System. out. p r i n t l n ( G r e e t i n g one : + g r e e t i n g 1. message ) ; Munindar P. Singh (NCSU) Service-Oriented Computing Fall

7 HelloAkkaJava.java (Main 2) // I n i t i a l l y a f t e r 0 seconds, send a G r e e t message e v e r y second to t h e g r e e t e r ; Spoof s e n d e r as G r e e t P r i n t e r ( new Actor below ) f i n a l A c t o r R e f g r e e t P r i n t e r = system. a c t o r O f ( Props. c r e a t e ( G r e e t P r i n t e r. c l a s s ) ) ; system. s c h e d u l e r ( ). s c h e d u l e ( D u r a t i o n. Zero ( ), D u r a t i o n. c r e a t e ( 1, TimeUnit. SECONDS), g r e e t e r, new G r e e t ( ), system. d i s p a t c h e r ( ), g r e e t P r i n t e r ) ; c a t c h ( TimeoutException ex ) { System. out. p r i n t l n ( Got a t i m e o u t w a i t i n g f o r r e p l y from an a c t o r ) ; ex. p r i n t S t a c k T r a c e ( ) ; p u b l i c s t a t i c c l a s s G r e e t P r i n t e r e x t e n d s A b s t r a c t A c t o r O v e r r i d e p u b l i c R e c e i v e c r e a t e R e c e i v e ( ) { r e t u r n r e c e i v e B u i l d e r ( ). match ( G r e e t i n g. c l a s s, ( g r e e t i n g ) > System. out. p r i n t l n ( g r e e t i n g. message ) ). b u i l d ( ) ; Munindar P. Singh (NCSU) Service-Oriented Computing Fall

8 The Receive Method A reaction rule for each type of message to be handled In Akka, the set of rules must be exhaustive in that all other messages will publish an UnhandledMessage to the ActorSystem s EventStream Best practice is to include a default rule (using matchany in Java) for unexpected messages Good practice to Separately describe the allowed message types, e.g., as static classes in Java Write each message s handler as a separate little method An actor s receive method A (partial) function object stored within the actor Hot swapping the receive : Avoid unless essential Changed through context.become method Alternative: push new behavior and use unbecome to post Munindar P. Singh (NCSU) Service-Oriented Computing Fall

9 Messages Immutable objects Not enforced by Java, so beware No delivery guarantees, pairwise FIFO May be lost May be duplicated Option to ensure at least once delivery Pairwise FIFO If An actor A sends two messages to actor B and Both messages arrive Then They arrive in order Messages to same recipient from distinct originating actors are unrelated May be arbitrarily interleaved If your application requires some assumptions of delivery Verify them yourself: use acknowledgments Achieve them yourself: use retries Munindar P. Singh (NCSU) Service-Oriented Computing Fall

10 Messages: Programming tell Asynchronous Send message and return immediately Preferable to maximize decoupling ask Asynchronous Send message and return a Future what will contain the reply Greater overhead in maintaining the context than for tell Timeout t = new Timeout ( D u r a t i o n. c r e a t e ( 5, TimeUnit. SECONDS) ) ; C o m p l e t a b l e F u t u r e <Object> f u t u r e 2 = ask ( actorb, a n o t h e r r e q u e s t, t ). t o C o m p l e t a b l e F u t u r e ( ) ; The CompletableFuture class supports joining futures, piping, and so on Munindar P. Singh (NCSU) Service-Oriented Computing Fall

11 ActorSystem / root (and its guardian or supervisor) /user user space (and its guardian or supervisor), called Guardian /system system space (and its guardian or supervisor) Any actors we create are under /user, although we create actors through system.actorof : children (called top-level actors) of /user context.actorof : their descendants (all levels) Every actor has a parent or supervisor in whose scope it is created Stopping an actor: recursively: children first; then self getcontext().stop(child) getcontext().stop(getself()) PoisonPill message to stop an actor in its tracks after the previously arrived (enqueued) messages are processed Munindar P. Singh (NCSU) Service-Oriented Computing Fall

12 Exceptions Current message Already removed from mailbox and potentially lost Unless explicit action to save the message or process it again Mailbox Preserved, as remaining after the current message was removed Available to the restarted actor, if any Supervision: An exception throwing actor is suspended and control passed to its supervisor The supervisor decides the fate of the actor Resume: back to where it was when the exception occurred Restart: reset its internal state to initial Stop: end it Akka provides a rich set of hooks through which to customize behavior Pre and post of the major events Start, Stop, Restart For example, prerestart() Munindar P. Singh (NCSU) Service-Oriented Computing Fall

13 Exceptions: Supervisor Strategy No call stack to pass an exception Traditional idea doesn t work Not clear which past or future caller should get the exception Therefore, pass to supervisor Can apply its strategy A couple of strategies are predefined One for One Strategy If a child (supervisee) actor produces an exception, deal with that actor All for One Strategy If the child actors are performing pieces of the same transaction and those not throwing an exception may be affected Predefined (fixed set of) directives on how to deal with a spoiled child Resume Stop Restart Escalate Munindar P. Singh (NCSU) Service-Oriented Computing Fall

14 Exception Handling: Throwing c l a s s MadeUpException ( msg : S t r i n g ) e x t e n d s E x c e p t i o n ( msg ) { c l a s s J u s t B e c a u s e E x c e p t i o n ( msg : S t r i n g ) e x t e n d s E x c e p t i o n ( msg ) { c l a s s S u p e r v i s e e A c t o r ( i d : I n t ) e x t e n d s Actor w i t h A c t o r L o g g i n g {... o v e r r i d e d e f r e c e i v e : R e c e i v e = { c a s e S u p e r v i s e e A c t o r. F a i l => l o g. i n f o ( s $ s e l f f a i l s now, i d e n t i f i e r = $ i d e n t i f i e r ; A c t o r R e f = $ t h i s ) throw new J u s t B e c a u s e E x c e p t i o n ( s $ s e l f, i d e n t i f i e r = $ i d e n t i f i e r, upon r e c e i v i n g a F a i l message ) c a s e S u p e r v i s e e A c t o r. Nudge => i m p o r t u t i l. Random i f ( Random. n e x t B o o l e a n ( ) ) throw new MadeUpException ( s $ s e l f, i d e n t i f i e r = $ i d e n t i f i e r, random e f f e c t on a Nudge message ) l o g. i n f o ( s $ s e l f r e c e i v e s nudge from $sender, i d e n t i f i e r = $ i d e n t i f i e r ; A c t o r R e f = $ t h i s ) Munindar P. Singh (NCSU) Service-Oriented Computing Fall

15 Exception Handling: Catching c l a s s S u p e r v i s o r A c t o r e x t e n d s Actor w i t h A c t o r L o g g i n g {... v a l c h i l d = c o n t e x t. a c t o r O f (... ) o v e r r i d e d e f r e c e i v e : R e c e i v e = { c a s e S u p e r v i s o r A c t o r. F a i l C h i l d => c h i l d! S u p e r v i s e e A c t o r. F a i l c a s e S u p e r v i s o r A c t o r. NudgeChild => c h i l d! S u p e r v i s e e A c t o r. Nudge o v e r r i d e v a l s u p e r v i s o r S t r a t e g y = OneForOneStrategy ( maxnrofretries = 1, withintimerange = 5 second ) { c a s e : A r i t h m e t i c E x c e p t i o n => Resume c a s e : N u l l P o i n t e r E x c e p t i o n => R e s t a r t c a s e : I l l e g a l A r g u m e n t E x c e p t i o n => Stop c a s e : I O E x c e p t i o n => Stop c a s e x : J u s t B e c a u s e E x c e p t i o n => { l o g. e r r o r ( s J u s t B e c a u s e E x c e p t i o n o c c u r r e d f o r t h e most o u t r a g e o u s r e a s o n ; \ n<<<$x>>>\n R e s t a r t i n g ) R e s t a r t c a s e : MadeUpException => { l o g. e r r o r ( s MadeUpException o c c u r r e d ; \ n Resuming ) Resume c a s e : E x c e p t i o n => E s c a l a t e

16 End-to-End Principle Popularized by Jerome Saltzer, David Reed, and David Clark Originally formulated for computer network protocols Usual examples pertain to error checking and performance A similar case could be made for encryption Applies to (distributed) computing more generally Any functionality that reflects application meaning must be verified at the end points Such functionality Does not need to be provided in the interior of the network, because it would need to be repeated at the end points Functionality that is not needed for a layer should not be provided in that layer because it is Either superfluous hence wastes resources Or is replicated hence wastes resources In the case of actors Ignoring message reliability and ordering is wise But why not also discard pairwise FIFO Munindar P. Singh (NCSU) Service-Oriented Computing Fall

17 Actors and Protocols Protocols to be introduced later Actors Separate business logic from infrastructure Protocols Separate reasoning from coordination Concordance: Protocols are geared for coordination of actor-like computational entities Asynchronous (nonblocking) messaging Shared nothing representation of local state Complementarity Actors assume pairwise FIFO Actors lack a model of multiparty interactions Actors lack an explicit model of causality for messages Actors don t provide an information model for messages Protocols deal with interactions; actors deal with computations that can interact Munindar P. Singh (NCSU) Service-Oriented Computing Fall

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014 Clojure Concurrency Constructs, Part Two CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014 1 Goals Cover the material presented in Chapter 4, of our concurrency textbook In particular,

More information

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization Distributed Systems Principles and Paradigms Maarten van Steen VU Amsterdam, Dept. Computer Science Room R4.20, steen@cs.vu.nl Chapter 06: Synchronization Version: November 16, 2009 2 / 39 Contents Chapter

More information

Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms Distributed Systems Principles and Paradigms Chapter 6 (version April 7, 28) Maarten van Steen Vrije Universiteit Amsterdam, Faculty of Science Dept. Mathematics and Computer Science Room R4.2. Tel: (2)

More information

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No!

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No! A subtle problem An obvious problem when LC = t do S doesn t make sense for Lamport clocks! there is no guarantee that LC will ever be S is anyway executed after LC = t Fixes: if e is internal/send and

More information

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version SDS developer guide Develop distributed and parallel applications in Java Nathanaël Cottin sds@ncottin.net http://sds.ncottin.net version 0.0.3 Copyright 2007 - Nathanaël Cottin Permission is granted to

More information

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H Cuts Cuts A cut C is a subset of the global history of H C = h c 1 1 hc 2 2...hc n n A cut C is a subset of the global history of H The frontier of C is the set of events e c 1 1,ec 2 2,...ec n n C = h

More information

Coordination. Failures and Consensus. Consensus. Consensus. Overview. Properties for Correct Consensus. Variant I: Consensus (C) P 1. v 1.

Coordination. Failures and Consensus. Consensus. Consensus. Overview. Properties for Correct Consensus. Variant I: Consensus (C) P 1. v 1. Coordination Failures and Consensus If the solution to availability and scalability is to decentralize and replicate functions and data, how do we coordinate the nodes? data consistency update propagation

More information

Distributed Systems Fundamentals

Distributed Systems Fundamentals February 17, 2000 ECS 251 Winter 2000 Page 1 Distributed Systems Fundamentals 1. Distributed system? a. What is it? b. Why use it? 2. System Architectures a. minicomputer mode b. workstation model c. processor

More information

Time in Distributed Systems: Clocks and Ordering of Events

Time in Distributed Systems: Clocks and Ordering of Events Time in Distributed Systems: Clocks and Ordering of Events Clocks in Distributed Systems Needed to Order two or more events happening at same or different nodes (Ex: Consistent ordering of updates at different

More information

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering Our Problem Global Predicate Detection and Event Ordering To compute predicates over the state of a distributed application Model Clock Synchronization Message passing No failures Two possible timing assumptions:

More information

Agreement. Today. l Coordination and agreement in group communication. l Consensus

Agreement. Today. l Coordination and agreement in group communication. l Consensus Agreement Today l Coordination and agreement in group communication l Consensus Events and process states " A distributed system a collection P of N singlethreaded processes w/o shared memory Each process

More information

Distributed Systems. 06. Logical clocks. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 06. Logical clocks. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 06. Logical clocks Paul Krzyzanowski Rutgers University Fall 2017 2014-2017 Paul Krzyzanowski 1 Logical clocks Assign sequence numbers to messages All cooperating processes can agree

More information

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at MAD Models & Algorithms for Distributed systems -- /5 -- download slides at http://people.rennes.inria.fr/eric.fabre/ 1 Today Runs/executions of a distributed system are partial orders of events We introduce

More information

Modern Functional Programming and Actors With Scala and Akka

Modern Functional Programming and Actors With Scala and Akka Modern Functional Programming and Actors With Scala and Akka Aaron Kosmatin Computer Science Department San Jose State University San Jose, CA 95192 707-508-9143 akosmatin@gmail.com Abstract For many years,

More information

Rollback-Recovery. Uncoordinated Checkpointing. p!! Easy to understand No synchronization overhead. Flexible. To recover from a crash:

Rollback-Recovery. Uncoordinated Checkpointing. p!! Easy to understand No synchronization overhead. Flexible. To recover from a crash: Rollback-Recovery Uncoordinated Checkpointing Easy to understand No synchronization overhead p!! Flexible can choose when to checkpoint To recover from a crash: go back to last checkpoint restart How (not)to

More information

I Can t Believe It s Not Causal! Scalable Causal Consistency with No Slowdown Cascades

I Can t Believe It s Not Causal! Scalable Causal Consistency with No Slowdown Cascades I Can t Believe It s Not Causal! Scalable Causal Consistency with No Slowdown Cascades Syed Akbar Mehdi 1, Cody Littley 1, Natacha Crooks 1, Lorenzo Alvisi 1,4, Nathan Bronson 2, Wyatt Lloyd 3 1 UT Austin,

More information

Distributed Algorithms Time, clocks and the ordering of events

Distributed Algorithms Time, clocks and the ordering of events Distributed Algorithms Time, clocks and the ordering of events Alberto Montresor University of Trento, Italy 2016/04/26 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International

More information

Time. To do. q Physical clocks q Logical clocks

Time. To do. q Physical clocks q Logical clocks Time To do q Physical clocks q Logical clocks Events, process states and clocks A distributed system A collection P of N single-threaded processes (p i, i = 1,, N) without shared memory The processes in

More information

S1 S2. checkpoint. m m2 m3 m4. checkpoint P checkpoint. P m5 P

S1 S2. checkpoint. m m2 m3 m4. checkpoint P checkpoint. P m5 P On Consistent Checkpointing in Distributed Systems Guohong Cao, Mukesh Singhal Department of Computer and Information Science The Ohio State University Columbus, OH 43201 E-mail: fgcao, singhalg@cis.ohio-state.edu

More information

Do we have a quorum?

Do we have a quorum? Do we have a quorum? Quorum Systems Given a set U of servers, U = n: A quorum system is a set Q 2 U such that Q 1, Q 2 Q : Q 1 Q 2 Each Q in Q is a quorum How quorum systems work: A read/write shared register

More information

Multiparty Computation (MPC) Arpita Patra

Multiparty Computation (MPC) Arpita Patra Multiparty Computation (MPC) Arpita Patra MPC offers more than Traditional Crypto! > MPC goes BEYOND traditional Crypto > Models the distributed computing applications that simultaneously demands usability

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University } 2017/11/15 Midterm } 2017/11/22 Final Project Announcement 2 1. Introduction 2.

More information

An Indian Journal FULL PAPER. Trade Science Inc. A real-time causal order delivery approach in largescale ABSTRACT KEYWORDS

An Indian Journal FULL PAPER. Trade Science Inc. A real-time causal order delivery approach in largescale ABSTRACT KEYWORDS [Type text] [Type text] [Type text] ISSN : 0974-7435 Volume 10 Issue 18 BioTechnology 2014 An Indian Journal FULL PAPER BTAIJ, 10(18), 2014 [10717-10723] A real-time causal order delivery approach in largescale

More information

6.852: Distributed Algorithms Fall, Class 10

6.852: Distributed Algorithms Fall, Class 10 6.852: Distributed Algorithms Fall, 2009 Class 10 Today s plan Simulating synchronous algorithms in asynchronous networks Synchronizers Lower bound for global synchronization Reading: Chapter 16 Next:

More information

DISTRIBUTED COMPUTER SYSTEMS

DISTRIBUTED COMPUTER SYSTEMS DISTRIBUTED COMPUTER SYSTEMS SYNCHRONIZATION Dr. Jack Lange Computer Science Department University of Pittsburgh Fall 2015 Topics Clock Synchronization Physical Clocks Clock Synchronization Algorithms

More information

6.867 Machine learning, lecture 23 (Jaakkola)

6.867 Machine learning, lecture 23 (Jaakkola) Lecture topics: Markov Random Fields Probabilistic inference Markov Random Fields We will briefly go over undirected graphical models or Markov Random Fields (MRFs) as they will be needed in the context

More information

Answers to selected exercises

Answers to selected exercises Answers to selected exercises A First Course in Stochastic Models, Henk C. Tijms 1.1 ( ) 1.2 (a) Let waiting time if passengers already arrived,. Then,, (b) { (c) Long-run fraction for is (d) Let waiting

More information

Today. Vector Clocks and Distributed Snapshots. Motivation: Distributed discussion board. Distributed discussion board. 1. Logical Time: Vector clocks

Today. Vector Clocks and Distributed Snapshots. Motivation: Distributed discussion board. Distributed discussion board. 1. Logical Time: Vector clocks Vector Clocks and Distributed Snapshots Today. Logical Time: Vector clocks 2. Distributed lobal Snapshots CS 48: Distributed Systems Lecture 5 Kyle Jamieson 2 Motivation: Distributed discussion board Distributed

More information

The Discrete EVent System specification (DEVS) formalism

The Discrete EVent System specification (DEVS) formalism The Discrete EVent System specification (DEVS) formalism Hans Vangheluwe The DEVS formalism was conceived by Zeigler [Zei84a, Zei84b] to provide a rigourous common basis for discrete-event modelling and

More information

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation Logical Time Nicola Dragoni Embedded Systems Engineering DTU Compute 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation 2013 ACM Turing Award:

More information

Outline F eria AADL behavior 1/ 78

Outline F eria AADL behavior 1/ 78 Outline AADL behavior Annex Jean-Paul Bodeveix 2 Pierre Dissaux 3 Mamoun Filali 2 Pierre Gaufillet 1 François Vernadat 2 1 AIRBUS-FRANCE 2 FéRIA 3 ELLIDIS SAE AS2C Detroit Michigan April 2006 FéRIA AADL

More information

Asynchronous Communication 2

Asynchronous Communication 2 Asynchronous Communication 2 INF4140 22.11.12 Lecture 11 INF4140 (22.11.12) Asynchronous Communication 2 Lecture 11 1 / 37 Overview: Last time semantics: histories and trace sets specification: invariants

More information

Mass Asset Additions. Overview. Effective mm/dd/yy Page 1 of 47 Rev 1. Copyright Oracle, All rights reserved.

Mass Asset Additions.  Overview. Effective mm/dd/yy Page 1 of 47 Rev 1. Copyright Oracle, All rights reserved. Overview Effective mm/dd/yy Page 1 of 47 Rev 1 System References None Distribution Oracle Assets Job Title * Ownership The Job Title [list@yourcompany.com?subject=eduxxxxx] is responsible for ensuring

More information

Simulation of Process Scheduling Algorithms

Simulation of Process Scheduling Algorithms Simulation of Process Scheduling Algorithms Project Report Instructor: Dr. Raimund Ege Submitted by: Sonal Sood Pramod Barthwal Index 1. Introduction 2. Proposal 3. Background 3.1 What is a Process 4.

More information

Chandy-Lamport Snapshotting

Chandy-Lamport Snapshotting Chandy-Lamport Snapshotting COS 418: Distributed Systems Precept 8 Themis Melissaris and Daniel Suo [Content adapted from I. Gupta] Agenda What are global snapshots? The Chandy-Lamport algorithm Why does

More information

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara Operating Systems Christopher Kruegel Department of Computer Science http://www.cs.ucsb.edu/~chris/ Many processes to execute, but one CPU OS time-multiplexes the CPU by operating context switching Between

More information

CS 425 / ECE 428 Distributed Systems Fall Indranil Gupta (Indy) Oct. 5, 2017 Lecture 12: Time and Ordering All slides IG

CS 425 / ECE 428 Distributed Systems Fall Indranil Gupta (Indy) Oct. 5, 2017 Lecture 12: Time and Ordering All slides IG CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy) Oct. 5, 2017 Lecture 12: Time and Ordering All slides IG Why Synchronization? You want to catch a bus at 6.05 pm, but your watch is

More information

Shared Memory vs Message Passing

Shared Memory vs Message Passing Shared Memory vs Message Passing Carole Delporte-Gallet Hugues Fauconnier Rachid Guerraoui Revised: 15 February 2004 Abstract This paper determines the computational strength of the shared memory abstraction

More information

Part I. System call overview. Secure Operating System Design and Implementation System Calls. Overview. Abstraction. Jon A. Solworth.

Part I. System call overview. Secure Operating System Design and Implementation System Calls. Overview. Abstraction. Jon A. Solworth. Secure Operating System Design and Implementation System Calls Jon A. Solworth Part I System call overview Dept. of Computer Science University of Illinois at Chicago February 1, 2011 Overview Abstraction

More information

Distributed Algorithms

Distributed Algorithms Distributed Algorithms December 17, 2008 Gerard Tel Introduction to Distributed Algorithms (2 nd edition) Cambridge University Press, 2000 Set-Up of the Course 13 lectures: Wan Fokkink room U342 email:

More information

Outline. PeerSim: Informal introduction. Resources. What is PeerSim? Alberto Montresor Gianluca Ciccarelli

Outline. PeerSim: Informal introduction. Resources. What is PeerSim? Alberto Montresor Gianluca Ciccarelli Outline PeerSim: Informal introduction Alberto Montresor Gianluca Ciccarelli Networking group - University of Trento April 3, 2009 1 2 files structure 3 1 / 45 2 / 45 Resources What is PeerSim? These slides

More information

Improper Nesting Example

Improper Nesting Example Improper Nesting Example One of the limits on the use of parbegin/parend, and any related constructs, is that the program involved must be properly nested. Not all programs are. For example, consider the

More information

Real Time Operating Systems

Real Time Operating Systems Real Time Operating ystems Luca Abeni luca.abeni@unitn.it Interacting Tasks Until now, only independent tasks... A job never blocks or suspends A task only blocks on job termination In real world, jobs

More information

Trace semantics: towards a unification of parallel paradigms Stephen Brookes. Department of Computer Science Carnegie Mellon University

Trace semantics: towards a unification of parallel paradigms Stephen Brookes. Department of Computer Science Carnegie Mellon University Trace semantics: towards a unification of parallel paradigms Stephen Brookes Department of Computer Science Carnegie Mellon University MFCSIT 2002 1 PARALLEL PARADIGMS State-based Shared-memory global

More information

UML. Design Principles.

UML. Design Principles. .. Babes-Bolyai University arthur@cs.ubbcluj.ro November 20, 2018 Overview 1 2 3 Diagrams Unified Modeling Language () - a standardized general-purpose modeling language in the field of object-oriented

More information

More on Input Distributions

More on Input Distributions More on Input Distributions Importance of Using the Correct Distribution Replacing a distribution with its mean Arrivals Waiting line Processing order System Service mean interarrival time = 1 minute mean

More information

Object Modeling Approach! Object Modeling Approach!

Object Modeling Approach! Object Modeling Approach! Object Modeling Approach! 1 Object Modeling Approach! Start with a problem statement! High-level requirements! Define object model! Identify objects and classes! Prepare data dictionary! Identify associations

More information

CSE 380 Computer Operating Systems

CSE 380 Computer Operating Systems CSE 380 Computer Operating Systems Instructor: Insup Lee & Dianna Xu University of Pennsylvania, Fall 2003 Lecture Note 3: CPU Scheduling 1 CPU SCHEDULING q How can OS schedule the allocation of CPU cycles

More information

Time, Clocks, and the Ordering of Events in a Distributed System

Time, Clocks, and the Ordering of Events in a Distributed System Time, Clocks, and the Ordering of Events in a Distributed System Motivating example: a distributed compilation service FTP server storing source files, object files, executable file stored files have timestamps,

More information

Distributed Systems 8L for Part IB

Distributed Systems 8L for Part IB Distributed Systems 8L for Part IB Handout 2 Dr. Steven Hand 1 Clocks Distributed systems need to be able to: order events produced by concurrent processes; synchronize senders and receivers of messages;

More information

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing CS 347 Parallel and Distributed Data Processing Spring 2016 & Clocks, Clocks, and the Ordering of Events in a Distributed System. L. Lamport, Communications of the ACM, 1978 Notes 15: & Clocks CS 347 Notes

More information

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This Recap: Finger Table Finding a using fingers Distributed Systems onsensus Steve Ko omputer Sciences and Engineering University at Buffalo N102 86 + 2 4 N86 20 + 2 6 N20 2 Let s onsider This

More information

6.852: Distributed Algorithms Fall, Class 24

6.852: Distributed Algorithms Fall, Class 24 6.852: Distributed Algorithms Fall, 2009 Class 24 Today s plan Self-stabilization Self-stabilizing algorithms: Breadth-first spanning tree Mutual exclusion Composing self-stabilizing algorithms Making

More information

Convolutional Coding LECTURE Overview

Convolutional Coding LECTURE Overview MIT 6.02 DRAFT Lecture Notes Spring 2010 (Last update: March 6, 2010) Comments, questions or bug reports? Please contact 6.02-staff@mit.edu LECTURE 8 Convolutional Coding This lecture introduces a powerful

More information

The L Machines are very high-level, in two senses:

The L Machines are very high-level, in two senses: What is a Computer? State of the machine. CMPSCI 630: Programming Languages An Abstract Machine for Control Spring 2009 (with thanks to Robert Harper) Internal registers, memory, etc. Initial and final

More information

Trivadis Integration Blueprint V0.1

Trivadis Integration Blueprint V0.1 Spring Integration Peter Welkenbach Principal Consultant peter.welkenbach@trivadis.com Agenda Integration Blueprint Enterprise Integration Patterns Spring Integration Goals Main Components Architectures

More information

IN4R21. Real-Time Specification for Java (RTSJ) Damien MASSON January 20, 2014

IN4R21. Real-Time Specification for Java (RTSJ) Damien MASSON  January 20, 2014 IN4R21 Real-Time Specification for Java (RTSJ) Damien MASSON http://www.esiee.fr/~massond/ January 20, 2014 References www.rtsj.org Concurrent and Real-Time Programming in Java, Andy Wellings Real-Time

More information

Queueing Theory and Simulation. Introduction

Queueing Theory and Simulation. Introduction Queueing Theory and Simulation Based on the slides of Dr. Dharma P. Agrawal, University of Cincinnati and Dr. Hiroyuki Ohsaki Graduate School of Information Science & Technology, Osaka University, Japan

More information

Introduction to ArcGIS Server Development

Introduction to ArcGIS Server Development Introduction to ArcGIS Server Development Kevin Deege,, Rob Burke, Kelly Hutchins, and Sathya Prasad ESRI Developer Summit 2008 1 Schedule Introduction to ArcGIS Server Rob and Kevin Questions Break 2:15

More information

Lists, Stacks, and Queues (plus Priority Queues)

Lists, Stacks, and Queues (plus Priority Queues) Lists, Stacks, and Queues (plus Priority Queues) The structures lists, stacks, and queues are composed of similar elements with different operations. Likewise, with mathematics: (Z, +, 0) vs. (Z,, 1) List

More information

Scalable Failure Recovery for Tree-based Overlay Networks

Scalable Failure Recovery for Tree-based Overlay Networks Scalable Failure Recovery for Tree-based Overlay Networks Dorian C. Arnold University of Wisconsin Paradyn/Condor Week April 30 May 3, 2007 Madison, WI Overview Motivation Address the likely frequent failures

More information

MOST control systems are designed under the assumption

MOST control systems are designed under the assumption 2076 IEEE TRANSACTIONS ON AUTOMATIC CONTROL, VOL. 53, NO. 9, OCTOBER 2008 Lyapunov-Based Model Predictive Control of Nonlinear Systems Subject to Data Losses David Muñoz de la Peña and Panagiotis D. Christofides

More information

Time. Today. l Physical clocks l Logical clocks

Time. Today. l Physical clocks l Logical clocks Time Today l Physical clocks l Logical clocks Events, process states and clocks " A distributed system a collection P of N singlethreaded processes without shared memory Each process p i has a state s

More information

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms CS 249 Project Fall 2005 Wing Wong Outline Introduction Asynchronous distributed systems, distributed computations,

More information

ECE 407 Computer Aided Design for Electronic Systems. Simulation. Instructor: Maria K. Michael. Overview

ECE 407 Computer Aided Design for Electronic Systems. Simulation. Instructor: Maria K. Michael. Overview 407 Computer Aided Design for Electronic Systems Simulation Instructor: Maria K. Michael Overview What is simulation? Design verification Modeling Levels Modeling circuits for simulation True-value simulation

More information

Distributed Computing. Synchronization. Dr. Yingwu Zhu

Distributed Computing. Synchronization. Dr. Yingwu Zhu Distributed Computing Synchronization Dr. Yingwu Zhu Topics to Discuss Physical Clocks Logical Clocks: Lamport Clocks Classic paper: Time, Clocks, and the Ordering of Events in a Distributed System Lamport

More information

Clock Synchronization

Clock Synchronization Today: Canonical Problems in Distributed Systems Time ordering and clock synchronization Leader election Mutual exclusion Distributed transactions Deadlock detection Lecture 11, page 7 Clock Synchronization

More information

Axioms for Probability and Belief-Function Propagation

Axioms for Probability and Belief-Function Propagation Axioms for Probability and Belief-Function Propagation Prakash P. Shenoy and Glenn Shafer School of Business, Summerfield Hall, University of Kansas Lawrence, Kansas, 66045-2003, USA In this paper, we

More information

INF Models of concurrency

INF Models of concurrency INF4140 - Models of concurrency Fall 2017 October 17, 2017 Abstract This is the handout version of the slides for the lecture (i.e., it s a rendering of the content of the slides in a way that does not

More information

On Stabilizing Departures in Overlay Networks

On Stabilizing Departures in Overlay Networks On Stabilizing Departures in Overlay Networks Dianne Foreback 1, Andreas Koutsopoulos 2, Mikhail Nesterenko 1, Christian Scheideler 2, and Thim Strothmann 2 1 Kent State University 2 University of Paderborn

More information

Android Security Mechanisms

Android Security Mechanisms Android Security Mechanisms Lecture 8 Operating Systems Practical 7 December 2016 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license,

More information

Module - 19 Gated Latches

Module - 19 Gated Latches Digital Circuits and Systems Prof. Shankar Balachandran Department of Electrical Engineering Indian Institute of Technology, Bombay And Department of Computer Science and Engineering Indian Institute of

More information

Distributed systems Lecture 4: Clock synchronisation; logical clocks. Dr Robert N. M. Watson

Distributed systems Lecture 4: Clock synchronisation; logical clocks. Dr Robert N. M. Watson Distributed systems Lecture 4: Clock synchronisation; logical clocks Dr Robert N. M. Watson 1 Last time Started to look at time in distributed systems Coordinating actions between processes Physical clocks

More information

CS418 Operating Systems

CS418 Operating Systems CS418 Operating Systems Lecture 14 Queuing Analysis Textbook: Operating Systems by William Stallings 1 1. Why Queuing Analysis? If the system environment changes (like the number of users is doubled),

More information

Chapter 4 Deliberation with Temporal Domain Models

Chapter 4 Deliberation with Temporal Domain Models Last update: April 10, 2018 Chapter 4 Deliberation with Temporal Domain Models Section 4.4: Constraint Management Section 4.5: Acting with Temporal Models Automated Planning and Acting Malik Ghallab, Dana

More information

Realizability of Interactions in Collaboration Diagrams

Realizability of Interactions in Collaboration Diagrams Realizability of Interactions in Collaboration Diagrams Tevfik Bultan Department of Computer Science University of California Santa Barbara, CA 93106, USA bultan@cs.ucsb.edu Xiang Fu School of Computer

More information

Course Announcements. Bacon is due next Monday. Next lab is about drawing UIs. Today s lecture will help thinking about your DB interface.

Course Announcements. Bacon is due next Monday. Next lab is about drawing UIs. Today s lecture will help thinking about your DB interface. Course Announcements Bacon is due next Monday. Today s lecture will help thinking about your DB interface. Next lab is about drawing UIs. John Jannotti (cs32) ORMs Mar 9, 2017 1 / 24 ORMs John Jannotti

More information

Geodatabase An Introduction

Geodatabase An Introduction 2013 Esri International User Conference July 8 12, 2013 San Diego, California Technical Workshop Geodatabase An Introduction David Crawford and Jonathan Murphy Session Path The Geodatabase What is it?

More information

Fault-Tolerant Consensus

Fault-Tolerant Consensus Fault-Tolerant Consensus CS556 - Panagiota Fatourou 1 Assumptions Consensus Denote by f the maximum number of processes that may fail. We call the system f-resilient Description of the Problem Each process

More information

A Brief Introduction to Model Checking

A Brief Introduction to Model Checking A Brief Introduction to Model Checking Jan. 18, LIX Page 1 Model Checking A technique for verifying finite state concurrent systems; a benefit on this restriction: largely automatic; a problem to fight:

More information

Blocking Synchronization: Streams Vijay Saraswat (Dec 10, 2012)

Blocking Synchronization: Streams Vijay Saraswat (Dec 10, 2012) 1 Streams Blocking Synchronization: Streams Vijay Saraswat (Dec 10, 2012) Streams provide a very simple abstraction for determinate parallel computation. The intuition for streams is already present in

More information

TIME BOUNDS FOR SHARED OBJECTS IN PARTIALLY SYNCHRONOUS SYSTEMS. A Thesis JIAQI WANG

TIME BOUNDS FOR SHARED OBJECTS IN PARTIALLY SYNCHRONOUS SYSTEMS. A Thesis JIAQI WANG TIME BOUNDS FOR SHARED OBJECTS IN PARTIALLY SYNCHRONOUS SYSTEMS A Thesis by JIAQI WANG Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for

More information

arxiv: v1 [cs.dc] 22 Oct 2018

arxiv: v1 [cs.dc] 22 Oct 2018 FANTOM: A SCALABLE FRAMEWORK FOR ASYNCHRONOUS DISTRIBUTED SYSTEMS A PREPRINT Sang-Min Choi, Jiho Park, Quan Nguyen, and Andre Cronje arxiv:1810.10360v1 [cs.dc] 22 Oct 2018 FANTOM Lab FANTOM Foundation

More information

Event Operators: Formalization, Algorithms, and Implementation Using Interval- Based Semantics

Event Operators: Formalization, Algorithms, and Implementation Using Interval- Based Semantics Department of Computer Science and Engineering University of Texas at Arlington Arlington, TX 76019 Event Operators: Formalization, Algorithms, and Implementation Using Interval- Based Semantics Raman

More information

Branch Prediction based attacks using Hardware performance Counters IIT Kharagpur

Branch Prediction based attacks using Hardware performance Counters IIT Kharagpur Branch Prediction based attacks using Hardware performance Counters IIT Kharagpur March 19, 2018 Modular Exponentiation Public key Cryptography March 19, 2018 Branch Prediction Attacks 2 / 54 Modular Exponentiation

More information

Asynchronous Models For Consensus

Asynchronous Models For Consensus Distributed Systems 600.437 Asynchronous Models for Consensus Department of Computer Science The Johns Hopkins University 1 Asynchronous Models For Consensus Lecture 5 Further reading: Distributed Algorithms

More information

Robustness the art of preparing for the unexpected

Robustness the art of preparing for the unexpected Robustness the art of preparing for the unexpected Version 071123 23-Nov-07 INF5150 Unassailable IT-systems 1 The exceptional Data may have strange syntax or values we apply common data-parsing techniques

More information

A Logic of Authentication

A Logic of Authentication A Logic of Authentication by Burrows, Abadi, and Needham Presented by Adam Schuchart, Kathryn Watkins, Michael Brotzman, Steve Bono, and Sam Small Agenda The problem Some formalism The goals of authentication,

More information

Slides for Chapter 14: Time and Global States

Slides for Chapter 14: Time and Global States Slides for Chapter 14: Time and Global States From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, Addison-Wesley 2012 Overview of Chapter Introduction Clocks,

More information

Warsaw Community Schools Guidelines for School Delays and Closings due to Inclement Weather

Warsaw Community Schools Guidelines for School Delays and Closings due to Inclement Weather Warsaw Community Schools Guidelines for School Delays and Closings due to Inclement Weather Beliefs Weather conditions are both variable and extreme in Northern Indiana. WCS believes due to the large geographical

More information

Robustness the art of preparing for the unexpected

Robustness the art of preparing for the unexpected Robustness the art of preparing for the unexpected ICUA-ICUE 26-Oct-15 INF5150 Unassailable IT-systems 1 The exceptional Data may have strange syntax or values we apply common data-parsing techniques An

More information

Geodatabase Best Practices. Dave Crawford Erik Hoel

Geodatabase Best Practices. Dave Crawford Erik Hoel Geodatabase Best Practices Dave Crawford Erik Hoel Geodatabase best practices - outline Geodatabase creation Data ownership Data model Data configuration Geodatabase behaviors Data integrity and validation

More information

Section 6 Fault-Tolerant Consensus

Section 6 Fault-Tolerant Consensus Section 6 Fault-Tolerant Consensus CS586 - Panagiota Fatourou 1 Description of the Problem Consensus Each process starts with an individual input from a particular value set V. Processes may fail by crashing.

More information

These are special traffic patterns that create more stress on a switch

These are special traffic patterns that create more stress on a switch Myths about Microbursts What are Microbursts? Microbursts are traffic patterns where traffic arrives in small bursts. While almost all network traffic is bursty to some extent, storage traffic usually

More information

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan Note 6-1 Mars Pathfinder Timing Hiccups? When: landed on the

More information

Long-Short Term Memory and Other Gated RNNs

Long-Short Term Memory and Other Gated RNNs Long-Short Term Memory and Other Gated RNNs Sargur Srihari srihari@buffalo.edu This is part of lecture slides on Deep Learning: http://www.cedar.buffalo.edu/~srihari/cse676 1 Topics in Sequence Modeling

More information

Simple Instruction-Pipelining (cont.) Pipelining Jumps

Simple Instruction-Pipelining (cont.) Pipelining Jumps 6.823, L9--1 Simple ruction-pipelining (cont.) + Interrupts Updated March 6, 2000 Laboratory for Computer Science M.I.T. http://www.csg.lcs.mit.edu/6.823 Src1 ( j / ~j ) Src2 ( / Ind) Pipelining Jumps

More information

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc. Finite State Machines Introduction Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc. Such devices form

More information

Session-Based Queueing Systems

Session-Based Queueing Systems Session-Based Queueing Systems Modelling, Simulation, and Approximation Jeroen Horters Supervisor VU: Sandjai Bhulai Executive Summary Companies often offer services that require multiple steps on the

More information

Reliable Broadcast for Broadcast Busses

Reliable Broadcast for Broadcast Busses Reliable Broadcast for Broadcast Busses Ozalp Babaoglu and Rogerio Drummond. Streets of Byzantium: Network Architectures for Reliable Broadcast. IEEE Transactions on Software Engineering SE- 11(6):546-554,

More information