INF Models of concurrency
|
|
- Victoria Small
- 5 years ago
- Views:
Transcription
1 INF Models of concurrency RPC and Rendezvous INF4140 Lecture 15. Nov. 2017
2 RPC and Rendezvous
3 Outline More on asynchronous message passing interacting processes with different patterns of communication summary remote procedure calls concept, syntax, and meaning examples: time server, merge filters, exchanging values rendez-vous concept, syntax, and meaning examples: buffer, time server, exchanging values combinations of RPC, rendezvous and message passing Examples: bounded buffer, readers/writers 3 / 1
4 Interacting peers (processes): exchanging values example Look at processes as peers. Example: Exchanging values Consider n processes P[0],..., P[n 1], n > 1 every process has a number, stored in local variable v Goal: all processes knows the largest and smallest number. simplistic problem, but characteristic of distributed computation and information distribution 4 / 1
5 Different communication patterns P5 P4 P5 P4 P5 P4 P0 P0 P3 P0 P3 P1 P3 P2 P1 P2 P1 P2 centralized symetrical ring shaped 5 / 1
6 Centralized solution Process P[0] is the coordinator process: P[0] does the calculation The other processes sends their values to P[0] and waits for a reply. P1 P5 P0 P2 P4 P3 Number of messages: 1 (number of sends:) P[0]: n 1 P[1],..., P[n 1]: (n 1) Total: (n 1) + (n 1) = 2(n 1) 2n messages repeated computation Number of channels: n 1 For now in the pics: 1 line = 1 message (not 1 channel), but the notation in the pics is not 100% consistent. 6 / 1
7 Centralized solution: code chan v a l u e s ( i n t ), r e s u l t s [ 1.. n 1]( i n t s m a l l e s t, i n t l a r g e s t ) ; p r o c e s s P [ 0 ] { # c o o r d i n a t o r p r o c e s s i n t v :=... ; i n t new, s m a l l e s t := v, l a r g e s t := v ; # i n i t i a l i z a t i o n # g e t v a l u e s and s t o r e t h e l a r g e s t and s m a l l e s t f o r [ i = 1 to n 1] { r e c e i v e v a l u e s ( new ) ; i f ( new < s m a l l e s t ) s m a l l e s t := new ; i f ( new > l a r g e s t ) l a r g e s t := new ; # send r e s u l t s f o r [ i = 1 to n 1] send r e s u l t s [ i ] ( s m a l l e s t, l a r g e s t ) ; p r o c e s s P[ i = 1 to n 1] { i n t v :=... ; i n t s m a l l e s t, l a r g e s t ; send v a l u e s ( v ) ; r e c e i v e r e s u l t s [ i ] ( s m a l l e s t, l a r g e s t ) ; # F i g i n Andrews ( c o r r e c t e d a bug ) 7 / 1
8 Asymmetric solution in Go (1) f o r i :=0; i <m; i++ { go P ( i, v a l u e s, r e s u l t s [ i ], r ) f o r i :=0; i <m; i++ { v = < v a l u e s i f v > l a r g e s t { l a r g e s t = v fmt. P r i n t f ( " l a r g e s t %v\n", l a r g e s t ) f o r i := range r e s u l t s { r e s u l t s [ i ] < l a r g e s t 8 / 1
9 Asymmetric solution in Go (2) package main import ( " fmt " ; "math/ rand " ) func P( i i n t, vc chan i n t, r c chan i n t, r rand. Rand ) { v := r. I n t n (100) fmt. P r i n t f ( "P%v\n", v ) vc < v ; fmt. P r i n t f ( "", < r c ) 9 / 1
10 Symmetric solution P5 P4 P0 P3 P1 P2 Single-programme, multiple data (SPMD) -solution: Each process executes the same code and shares the results with all other processes. Number of messages: n processes sending n 1 messages each, Total: n(n 1) messages. Number of (bi-directional) channels: n(n 1) 10 / 1
11 Symmetric solution: code chan v a l u e s [ n ] ( i n t ) ; p r o c e s s P[ i = 0 to n 1] { i n t v :=... ; i n t new, s m a l l e s t := v, l a r g e s t := v ; # send v to a l l n 1 o t h e r p r o c e s s e s f o r [ j = 0 to n 1 s t j i ] send v a l u e s [ j ] ( v ) ; # g e t n 1 v a l u e s # and s t o r e t h e s m a l l e s t and l a r g e s t. f o r [ j = 1 to n 1] { # j not used i n t h e l o o p r e c e i v e v a l u e s [ i ] ( new ) ; i f ( new < s m a l l e s t ) s m a l l e s t := new ; i f ( new > l a r g e s t ) l a r g e s t := new ; # F i g from Andrews 11 / 1
12 Ring solution P5 P4 P0 P3 P1 P2 Almost symmetrical, except P[0], P[n 2] and P[n 1]. Each process executes the same code and sends the results to the next process (if necessary). Number of messages: P[0]: 2 P[1],..., P[n 3]: (n 3) 2 P[n 2]: 1 P[n 1]: (n 3) = 2(n 1) messages sent. Number of channels: n. 12 / 1
13 Ring solution: code (1) chan v a l u e s [ n ] ( i n t s m a l l e s t, i n t l a r g e s t ) ; p r o c e s s P [ 0 ] { # s t a r t s t h e exchange i n t v :=... ; i n t s m a l l e s t := v, l a r g e s t := v ; # send v to t h e n e x t p r o c e s s, P [ 1 ] send v a l u e s [ 1 ] ( s m a l l e s t, l a r g e s t ) ; # g e t t h e g l o b a l s m a l l e s t and l a r g e s t from P [ n 1] # and send them to P [ 1 ] r e c e i v e v a l u e s [ 0 ] ( s m a l l e s t, l a r g e s t ) ; send v a l u e s [ 1 ] ( s m a l l e s t, l a r g e s t ) ; 13 / 1
14 Ring solution: code (2) p r o c e s s P[ i = 1 to n 1] { i n t v :=... ; i n t s m a l l e s t, l a r g e s t ; # g e t s m a l l e s t and l a r g e s t so f a r, # and update them by comparing them to v r e c e i v e v a l u e s [ i ] ( s m a l l e s t, l a r g e s t ) i f ( v < s m a l l e s t ) s m a l l e s t := v ; i f ( v > l a r g e s t ) l a r g e s t := v ; # f o r w a r d t h e r e s u l t, and w a i t f o r t h e g l o b a l r e s u l t send v a l u e s [ ( i +1) mod n ] ( s m a l l e s t, l a r g e s t ) ; i f ( i < n 1) r e c e i v e v a l u e s [ i ] ( s m a l l e s t, l a r g e s t ) ; # f o r w a r d t h e g l o b a l r e s u l t, but not from P [ n 1] to P [ 0 ] i f ( i < n 2) send v a l u e s [ i +1]( s m a l l e s t, l a r g e s t ) ; # F i g from Andrews ( m o d i f i e d ) 14 / 1
15 Message passing: Summary Message passing: well suited to programming filters and interacting peers (where processes communicates one way by one or more channels). May be used for client/server applications, but: Each client must have its own reply channel In general: two way communication needs two channels many channels RPC and rendezvous are better suited for client/server applications. 15 / 1
16 Remote Procedure Call: main idea CALLER CALLEE a t computer A a t computer B op foo(formals); # declaration... call foo(args); -----> proc foo(formals) # new process... <----- end; / 1
17 RPC (cont.) RPC: combines elements from monitors and message passing As ordinary procedure call, but caller and callee may be on different machines. 2 Caller: blocked until called procedure is done, as with monitor calls and synchronous message passing. Asynchronous programming: not supported directly A new process handles each call. Potentially two way communication: caller sends arguments and receives return values. 2 cf. RMI 17 / 1
18 RPC: module, procedure, process Module: new program component contains both procedures and processes. module M h e a d e r s o f e x p o r t e d o p e r a t i o n s ; body v a r i a b l e d e c l a r a t i o n s ; i n i t i a l i z a t i o n code ; p r o c e d u r e s f o r e x p o r t e d o p e r a t i o n s ; l o c a l p r o c e d u r e s and p r o c e s s e s ; end M Modules may be executed on different machines M has: procedures and processes may share variables execute concurrently must be synchronized to achieve mutex May only communicate with processes in M by procedures exported by M 18 / 1
19 RPC: operations Declaration of operation O: op O(formal parameters.) [ returns result] ; Implementation of operation O: proc O(formal identifiers.) [ returns result identifier]{ declaration of local variables; statements Call of operation O in module M: 3 Processes: as before. call M.O(arguments) 3 Cf. static/class methods 19 / 1
20 Synchronization in modules RPC: primarily a communication mechanism within the module: in principle allowed: more than one process shared data need for synchronization two approaches 1. implicit : as in monitors: mutex built-in additionally condition variables (or semaphores) 2. explicit : 4 user-programmed mutex and synchronization (like semaphorse, local monitors etc.) 4 assumed in the following 20 / 1
21 Example: Time server (RPC) module providing timing services to processes in other modules. interface: two visible operations: get_time() returns int returns time of day delay(int interval) let the caller sleep a given number of time units multiple clients: may call get_time and delay at the same time Need to protect the variables. internal process that gets interrupts from machine clock and updates tod 21 / 1
22 Time server code (rpc) module TimeServer op get_time ( ) r e t u r n s i n t ; op d e l a y ( i n t i n t e r v a l ) ; body i n t tod := 0 ; # time o f day sem m := 1 ; # f o r mutex sem d [ n ] := ( [ n ] 0 ) ; # f o r d e l a y e d p r o c e s s e s queue o f ( i n t waketime, i n t p r o c e s s _ i d ) napq ; ## when m = 1, tod < waketime f o r d e l a y e d p r o c e s s e s proc get_time ( ) r e t u r n s time { time := tod ; proc d e l a y ( i n t i n t e r v a l ) { P(m) ; # assume u n i q u e myid and i [ 0, n 1] i n t waketime := tod + i n t e r v a l ; i n s e r t ( waketime, myid ) a t a p p r o p r i a t e p l a c e i n napq ; V(m) ; P( d [ myid ] ) ; # Wait to be awoken p r o c e s s Clock.... end TimeServer 22 / 1
23 Time server code: clock process p r o c e s s Clock { i n t i d ; s t a r t hardware t i m e r ; w h i l e ( t r u e ) { wait f o r i n t e r r u p t, then r e s t a r t hardware t i m e r tod := tod + 1 ; P(m) ; # mutex w h i l e ( tod s m a l l e s t waketime on napq ) { remove ( waketime, i d ) from napq ; # book k e e p i n g V( d [ i d ] ) ; # awake p r o c e s s V(m) ; end TimeServer # F i g o f Andrews # mutex 23 / 1
24 Rendezvous RPC: offers inter-module communication synchronization (often): must be programmed explicitly Rendezvous: known from the language Ada (US DoD) combines communication and synchronization between processes No new process created for each call instead: perform rendezvous with existing process operations are executed one at the time synch_send and receive may be considered as primitive rendezvous. cf. also join-synchronization 24 / 1
25 Rendezvous: main idea CALLER CALLEE a t computer A a t computer B op foo(formals); # declaration # existing process call foo(args); -----> in foo(formals) -> BODY; <----- ni / 1
26 Rendezvous: module declaration module M op O 1 ( t y p e s ) ;... op O n ( t y p e s ) ; body p r o c e s s P 1 { v a r i a b l e d e c l a r a t i o n s ; w h i l e ( t r u e ) # s t a n d a r d p a t t e r n i n O 1 ( f o r m a l s ) and B 1 > S 1 ;... [ ] O n ( f o r m a l s ) and B n > S n ; n i... o t h e r p r o c e s s e s end M 26 / 1
27 Calls and input statements Call: c a l l O i (expr 1,..., expr m ) ; Input statement, multiple guarded expressions: i n O 1 (v 1,... v m1 ) and B 1 > S 1 ;... [ ] O n(v 1,... v mn ) and B n > S n ; n i The guard consists of: and B i synchronization expression (optional) S i statements (one or more) The variables v 1,..., v mi may be referred by B i and S i may read/write to them. 5 5 once again: no side-effects in B!!! 27 / 1
28 Semantics of input statement Consider the following: i n... [ ] O i (v i,..., v mi ) and B i > S i ;... n i The guard succeeds when O i is called and B i is true (or omitted). Execution of the in statement: Delays until a guard succeeds If more than one guard succeed, the oldest call is served 6 Values are returned to the caller The the call- and in-statements terminates 6 this may be changed using additional syntax (by), see [Andrews, 2000]. 28 / 1
29 Different variants different versions of rendezvous, depending on the language origin: ADA (accept-statement) (see [Andrews, 2000, Section 8.6]) design variation points synchronization expressions or not? scheduling expressions or not? can the guard inspect the values for input variables or not? non-determinism checking for absence of messages? priority checking in more than one operation? 29 / 1
30 Bounded buffer with rendezvous module BoundedBuffer op d e p o s i t ( TypeT ), f e t c h ( r e s u l t TypeT ) ; body p r o c e s s B u f f e r { elem buf [ n ] ; i n t f r o n t := 0, r e a r := 0, count := 0 ; w h i l e ( t r u e ) i n d e p o s i t ( item ) and count < n > buf [ r e a r ] := item ; count++; r e a r := ( r e a r +1) mod n ; [ ] f e t c h ( item ) and count > 0 > item := buf [ f r o n t ] ; count ; f r o n t := ( f r o n t +1) mod n ; n i end BoundedBuffer # F i g o f Andrews 30 / 1
31 Example: time server (rendezvous) module TimeServer op get_time ( ) r e t u r n s i n t ; op d e l a y ( i n t ) ; # a b s o l u t e waketime as argument op t i c k ( ) ; # c a l l e d by t h e c l o c k i n t e r r u p t h a n d l e r body p r o c e s s Timer { i n t tod := 0 ; s t a r t t i m e r ; w h i l e ( t r u e ) i n get_time ( ) r e t u r n s time > time := tod ; [ ] d e l a y ( waketime ) and waketime <= tod > s k i p ; [ ] t i c k ( ) > { tod++; r e s t a r t t i m e r ; n i end TimeServer # F i g o f Andrews 31 / 1
32 RPC, rendezvous and message passing We do now have several combinations: invocation service effect call proc procedure call (RPC) call in rendezvous send proc dynamic process creation, asynchronous proc. send in asynchronous message passing in addition (not in Andrews) asynchronous procedure call, wait-by-necessity, futures 32 / 1
33 Rendezvous, message passing and semaphores Comparing input statements and receive: in O(a 1,...,a n ) ->v 1 =a 1,...,v n =a n ni receive O(v 1,..., v n ) Comparing message passing and semaphores: send O() and receive O() V(O) and P(O) 33 / 1
34 Bounded buffer: procedures and semaphores (simulated by channels) module BoundedBuffer op d e p o s i t ( typet ), f e t c h ( r e s u l t typet ) ; body elem buf [ n ] ; i n t f r o n t = 0, r e a r = 0 ; # l o c a l o p e r a t i o n to s i m u l a t e semaphores op empty ( ), f u l l ( ), mutexd ( ), mutexf ( ) ; # o p e r a t i o n s send mutexd ( ) ; send mutexf ( ) ; # i n i t. " semaphores " to 1 f o r [ i = 1 to n ] # i n i t. empty "semaphore " to n send empty ( ) ; proc d e p o s i t ( item ) { r e c e i v e empty ( ) ; r e c e i v e mutexd ( ) ; buf [ r e a r ] = item ; r e a r = ( r e a r +1) mod n ; send mutexd ( ) ; send f u l l ( ) ; proc f e t c h ( item ) { r e c e i v e f u l l ( ) ; r e c e i v e mutexf ( ) ; item = buf [ f r o n t ] ; f r o n t = ( f r o n t +1) mod n ; send mutexf ( ) ; send empty ( ) ; end BoundedBuffer # F i g o f Andrews 34 / 1
35 Bounded buffer with rendezvous module BoundedBuffer op d e p o s i t ( TypeT ), f e t c h ( r e s u l t TypeT ) ; body p r o c e s s B u f f e r { elem buf [ n ] ; i n t f r o n t := 0, r e a r := 0, count := 0 ; w h i l e ( t r u e ) i n d e p o s i t ( item ) and count < n > buf [ r e a r ] := item ; count++; r e a r := ( r e a r +1) mod n ; [ ] f e t c h ( item ) and count > 0 > item := buf [ f r o n t ] ; count ; f r o n t := ( f r o n t +1) mod n ; n i end BoundedBuffer # F i g o f Andrews 35 / 1
36 The primitive?o in rendezvous New primitive on operations, similar to empty(... ) for condition variables and channels.?o means number of pending invocations of operation O. Useful in the input statement to give priority: i n [ ] O 1... > S 1 ; O 2... and (?O 1 = 0) > S 2 ; n i Here O 1 has a higher priority than O / 1
37 Readers and writers module ReadersWriters op r e a d ( r e s u l t t y p e s ) ; # u s e s RPC op w r i t e ( t y p e s ) ; # u s e s r e n d e z v o u s body op s t a r t r e a d ( ), e n d r e ad ( ) ; # l o c a l ops.... d a t a b a s e (DB )... ; proc r e a d ( v a r s ) { c a l l s t a r t r e a d ( ) ; # g e t r e a d a c c e s s... r e a d v a r s from DB... ; send e n d read ( ) ; # f r e e DB p r o c e s s W r i t e r { i n t nr := 0 ; w h i l e ( t r u e ) end i n s t a r t r e a d ( ) > nr++; [ ] e n dread ( ) > nr ; [ ] w r i t e ( v a r s ) and nr = 0 >... w r i t e v a r s to DB... ; n i ReadersWriters 37 / 1
38 Readers and writers: prioritize writers module R e a d e r s W r i t e r s op r e a d ( r e s u l t typet ) ; # u s e s RPC op w r i t e ( typet ) ; # u s e s r e n d e z v o u s body op s t a r t r e a d ( ), e n d r e ad ( ) ; # l o c a l ops.... d a t a b a s e (DB )... ; proc r e a d ( v a r s ) { c a l l s t a r t r e a d ( ) ; # g e t r e a d a c c e s s... r e a d v a r s from DB... ; send e n d read ( ) ; # f r e e DB p r o c e s s W r i t e r { i n t nr := 0 ; w h i l e ( t r u e ) i n s t a r t r e a d ( ) and? w r i t e = 0 > nr++; [ ] e n dread ( ) > nr ; [ ] w r i t e ( v a r s ) and nr = 0 >... w r i t e v a r s to DB... ; n i end R e a d e r s W r i t e r s 38 / 1
39 References I [int, 2013] (2013). Intel 64 and IA-32 Architectures Software Developer s Manual. Combined Volumes:1, 2A, 2B, 2C, 3A, 3B and 3C. Intel. [Adve and Gharachorloo, 1995] Adve, S. V. and Gharachorloo, K. (1995). Shared memory consistency models: A tutorial. Research Report 95/7, Digital WRL. [Adve and Hill, 1990] Adve, S. V. and Hill, M. D. (1990). Weak ordering a new definition. SIGARCH Computer Architecture News, 18(3a). [Anderson, 1990] Anderson, T. E. (1990). The performance of spin lock alternatives for shared-memory multiprocessors. IEEE Transactions on Parallel and Distributed System, 1(1):6 16. [Andrews, 2000] Andrews, G. R. (2000). Foundations of Multithreaded, Parallel, and Distributed Programming. Addison-Wesley. [Go memory model, 2016] Go memory model (2016). The Go memory model. [Herlihy and Shavit, 2008] Herlihy, M. and Shavit, N. (2008). The Art of Multiprocessor Programming. Morgan Kaufmann. 39 / 1
40 References II [Lamport, 1979] Lamport, L. (1979). How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers, C-28(9): [Manson et al., 2005] Manson, J., Pugh, W., and Adve, S. V. (2005). The Java memory memory. In Proceedings of POPL 05. ACM. [Owell et al., 2009] Owell, S., Sarkar, S., and Sewell, P. (2009). A better x86 memory model: x86-tso. In Berghofer, S., Nipkow, T., Urban, C., and Wenzel, M., editors, Theorem Proving in Higher-Order Logic: 10th International Conference, TPHOLs 09, volume 5674 of Lecture Notes in Computer Science. [Sewell et al., 2010] Sewell, P., Sarkar, S., Nardelli, F., and O.Myreen, M. (2010). x86-tso: A rigorous and usable programmer s model for x86 multiprocessors. Communications of the ACM, 53(7). 40 / 1
INF Models of concurrency
Monitors INF4140 - Models of concurrency Monitors, lecture 4 Fall 2017 27. September 2017 2 / 49 Overview Concurrent execution of different processes Communication by shared variables Processes may interfere
More informationOutline 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 informationINF 4140: Models of Concurrency Series 3
Universitetet i Oslo Institutt for Informatikk PMA Olaf Owe, Martin Steffen, Toktam Ramezani INF 4140: Models of Concurrency Høst 2016 Series 3 14. 9. 2016 Topic: Semaphores (Exercises with hints for solution)
More informationOperating Systems. VII. Synchronization
Operating Systems VII. Synchronization Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Outline Synchronization issues 2/22 Fall 2017 Institut
More informationINF 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 informationSlides 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 informationMulticore Semantics and Programming
Multicore Semantics and Programming Peter Sewell Tim Harris University of Cambridge Oracle October November, 2015 p. 1 These Lectures Part 1: Multicore Semantics: the concurrency of multiprocessors and
More informationTime. 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 informationCS 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 informationPySy: A Python Package for Enhanced Concurrent Programming. TODD WILLIAMSON B.S (University of California at Davis) 2007 THESIS
PySy: A Python Package for Enhanced Concurrent Programming By TODD WILLIAMSON B.S (University of California at Davis) 2007 THESIS Submitted in partial satisfaction of the requirements for the degree of
More informationIN4R21. 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 informationReal 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 informationLecture 4: Process Management
Lecture 4: Process Management Process Revisited 1. What do we know so far about Linux on X-86? X-86 architecture supports both segmentation and paging. 48-bit logical address goes through the segmentation
More informationHigh Performance Computing
Master Degree Program in Computer Science and Networking, 2014-15 High Performance Computing 2 nd appello February 11, 2015 Write your name, surname, student identification number (numero di matricola),
More informationGo Tutorial. Ian Lance Taylor. Introduction. Why? Language. Go Tutorial. Ian Lance Taylor. GCC Summit, October 27, 2010
GCC Summit, October 27, 2010 Go Go is a new experimental general purpose programming language. Main developers are: Russ Cox Robert Griesemer Rob Pike Ken Thompson It was released as free software in November
More informationOur 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 informationIntroduction to functions
Introduction to functions Comp Sci 1570 Introduction to C++ Outline 1 2 Functions A function is a reusable sequence of s designed to do a particular job. In C++, a function is a group of s that is given
More informationDo 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 informationDISTRIBUTED 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 informationINF Models of concurrency
INF4140 - Models of concurrency Høsten 2015 November 18, 2015 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
More informationAbsence of Global Clock
Absence of Global Clock Problem: synchronizing the activities of different part of the system (e.g. process scheduling) What about using a single shared clock? two different processes can see the clock
More informationClocks in Asynchronous Systems
Clocks in Asynchronous Systems The Internet Network Time Protocol (NTP) 8 Goals provide the ability to externally synchronize clients across internet to UTC provide reliable service tolerating lengthy
More informationLab Course: distributed data analytics
Lab Course: distributed data analytics 01. Threading and Parallelism Nghia Duong-Trung, Mohsan Jameel Information Systems and Machine Learning Lab (ISMLL) University of Hildesheim, Germany International
More informationAn introduction to Uppaal and Timed Automata MVP5 1
An introduction to Uppaal and Timed Automata MVP5 1 What is Uppaal? (http://www.uppaal.com/) A simple graphical interface for drawing extended finite state machines (automatons + shared variables A graphical
More informationSocket Programming. Daniel Zappala. CS 360 Internet Programming Brigham Young University
Socket Programming Daniel Zappala CS 360 Internet Programming Brigham Young University Sockets, Addresses, Ports Clients and Servers 3/33 clients request a service from a server using a protocol need an
More informationINF 4140: Models of Concurrency Series 4
Universitetet i Oslo Institutt for Informatikk PMA Olaf Owe, Martin Steffen, Toktam Ramezani INF 4140: Models of Concurrency Series 4 Høst 2016 30. 9. 2016 Topic: Monitors (Exercises with hints for solution)
More informationDistributed 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 informationClojure 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 informationImproper 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 informationVerifying Randomized Distributed Algorithms with PRISM
Verifying Randomized Distributed Algorithms with PRISM Marta Kwiatkowska, Gethin Norman, and David Parker University of Birmingham, Birmingham B15 2TT, United Kingdom {M.Z.Kwiatkowska,G.Norman,D.A.Parker}@cs.bham.ac.uk
More informationDistributed 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 informationDistributed 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 informationLecture 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 informationChapter 11 Time and Global States
CSD511 Distributed Systems 分散式系統 Chapter 11 Time and Global States 吳俊興 國立高雄大學資訊工程學系 Chapter 11 Time and Global States 11.1 Introduction 11.2 Clocks, events and process states 11.3 Synchronizing physical
More informationDistributed 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 informationReal Time Operating Systems
Real Time Operating ystems hared Resources Luca Abeni Credits: Luigi Palopoli, Giuseppe Lipari, and Marco Di Natale cuola uperiore ant Anna Pisa -Italy Real Time Operating ystems p. 1 Interacting Tasks
More informationMarwan Burelle. Parallel and Concurrent Programming. Introduction and Foundation
and and marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Outline 1 2 and 3 and Evolutions and Next evolutions in processor tends more on more on growing of cores number GPU and similar extensions
More informationTime. 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 informationSection 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 informationShared 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 informationAgreement. 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 informationSDS 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 informationAdministrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application
Administrivia 1. markem/cs333/ 2. Staff 3. Prerequisites 4. Grading Course Objectives 1. Theory and application 2. Benefits 3. Labs TAs Overview 1. What is a computer system? CPU PC ALU System bus Memory
More informationBranch 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 informationApplying Architectural Patterns for Parallel Programming Solving the One-dimensional Heat Equation
Applying Architectural Patterns for Parallel Programming Solving the One-dimensional Heat Equation Jorge L. Ortega Arjona Departamento de Matemáticas Facultad de Ciencias, UNAM. jloa@ciencias.unam.mx Abstract
More informationModern 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 informationOverview: Synchronous Computations
Overview: Synchronous Computations barriers: linear, tree-based and butterfly degrees of synchronization synchronous example 1: Jacobi Iterations serial and parallel code, performance analysis synchronous
More informationCan an Operation Both Update the State and Return a Meaningful Value in the Asynchronous PRAM Model?
Can an Operation Both Update the State and Return a Meaningful Value in the Asynchronous PRAM Model? Jaap-Henk Hoepman Department of Computer Science, University of Twente, the Netherlands hoepman@cs.utwente.nl
More informationBarrier. Overview: Synchronous Computations. Barriers. Counter-based or Linear Barriers
Overview: Synchronous Computations Barrier barriers: linear, tree-based and butterfly degrees of synchronization synchronous example : Jacobi Iterations serial and parallel code, performance analysis synchronous
More informationLSN 15 Processor Scheduling
LSN 15 Processor Scheduling ECT362 Operating Systems Department of Engineering Technology LSN 15 Processor Scheduling LSN 15 FCFS/FIFO Scheduling Each process joins the Ready queue When the current process
More informationTowards a Practical Secure Concurrent Language
Towards a Practical Secure Concurrent Language Stefan Muller and Stephen Chong TR-05-12 Computer Science Group Harvard University Cambridge, Massachusetts Towards a Practical Secure Concurrent Language
More informationAtomic m-register operations
Atomic m-register operations Michael Merritt Gadi Taubenfeld December 15, 1993 Abstract We investigate systems where it is possible to access several shared registers in one atomic step. We characterize
More informationLogical 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 informationDistributed 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 informationOwicki-Gries Reasoning for Weak Memory Models
Owicki-Gries Reasoning for Weak Memory Models Ori Lahav and Viktor Vafeiadis Max Planck Institute for Software Systems (MPI-SWS) Abstract. We show that even in the absence of auxiliary variables, the wellknown
More informationDegradable Agreement in the Presence of. Byzantine Faults. Nitin H. Vaidya. Technical Report #
Degradable Agreement in the Presence of Byzantine Faults Nitin H. Vaidya Technical Report # 92-020 Abstract Consider a system consisting of a sender that wants to send a value to certain receivers. Byzantine
More informationModeling Concurrent Systems
Modeling Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at
More informationParallel Performance Evaluation through Critical Path Analysis
Parallel Performance Evaluation through Critical Path Analysis Benno J. Overeinder and Peter M. A. Sloot University of Amsterdam, Parallel Scientific Computing & Simulation Group Kruislaan 403, NL-1098
More informationTrace 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 informationThe 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 informationShared resources. Sistemi in tempo reale. Giuseppe Lipari. Scuola Superiore Sant Anna Pisa -Italy
istemi in tempo reale hared resources Giuseppe Lipari cuola uperiore ant Anna Pisa -Italy inher.tex istemi in tempo reale Giuseppe Lipari 7/6/2005 12:35 p. 1/21 Interacting tasks Until now, we have considered
More informationCommunicating Parallel Processes. Stephen Brookes
Communicating Parallel Processes Stephen Brookes Carnegie Mellon University Deconstructing CSP 1 CSP sequential processes input and output as primitives named parallel composition synchronized communication
More informationDistributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour
Distributed Algorithms (CAS 769) Week 1: Introduction, Logical clocks, Snapshots Dr. Borzoo Bonakdarpour Department of Computing and Software McMaster University Dr. Borzoo Bonakdarpour Distributed Algorithms
More informationExclusive Access to Resources in Distributed Shared Memory Architecture
Exclusive Access to Resources in Distributed Shared Memory Architecture Ludwik Czaja 1,2 1 Institute of Informatics, The University of Warsaw 2 University of Economics and Computer Science Vistula in Warsaw
More informationTestability. Shaahin Hessabi. Sharif University of Technology. Adapted from the presentation prepared by book authors.
Testability Lecture 6: Logic Simulation Shaahin Hessabi Department of Computer Engineering Sharif University of Technology Adapted from the presentation prepared by book authors Slide 1 of 27 Outline What
More informationToday. 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 informationConsistent 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 informationTime 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 informationFormal Methods in Software Engineering
Formal Methods in Software Engineering Modeling Prof. Dr. Joel Greenyer October 21, 2014 Organizational Issues Tutorial dates: I will offer two tutorial dates Tuesdays 15:00-16:00 in A310 (before the lecture,
More informationTDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.
TDDI4 Concurrent Programming, Operating Systems, and Real-time Operating Systems CPU Scheduling Overview: CPU Scheduling CPU bursts and I/O bursts Scheduling Criteria Scheduling Algorithms Multiprocessor
More informationCSE 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 informationCptS 464/564 Fall Prof. Dave Bakken. Cpt. S 464/564 Lecture January 26, 2014
Overview of Ordering and Logical Time Prof. Dave Bakken Cpt. S 464/564 Lecture January 26, 2014 Context This material is NOT in CDKB5 textbook Rather, from second text by Verissimo and Rodrigues, chapters
More informationInverse Orchestra: An approach to find faster solution of matrix inversion through Cramer s rule
Inverse Orchestra: An approach to find faster solution of matrix inversion through Cramer s rule Shweta Agrawal, Rajkamal School of Computer Science & Information Technology, DAVV, Indore (M.P.), India
More informationExperiments with Measuring Time in PRISM 4.0 (Addendum)
Experiments with Measuring Time in PRISM 4.0 (Addendum) Wolfgang Schreiner Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria Wolfgang.Schreiner@risc.jku.at April
More informationCS 6112 (Fall 2011) Foundations of Concurrency
CS 6112 (Fall 2011) Foundations of Concurrency 29 November 2011 Scribe: Jean-Baptiste Jeannin 1 Readings The readings for today were: Eventually Consistent Transactions, by Sebastian Burckhardt, Manuel
More informationFigure 10.1 Skew between computer clocks in a distributed system
Figure 10.1 Skew between computer clocks in a distributed system Network Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001
More informationDesign of Distributed Systems Melinda Tóth, Zoltán Horváth
Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052
More informationOwicki-Gries Reasoning for Weak Memory Models
Owicki-Gries Reasoning for Weak Memory Models Ori Lahav and Viktor Vafeiadis Max Planck Institute for Software Systems (MPI-SWS) Abstract. We show that even in the absence of auxiliary variables, the wellknown
More informationHow to deal with uncertainties and dynamicity?
How to deal with uncertainties and dynamicity? http://graal.ens-lyon.fr/ lmarchal/scheduling/ 19 novembre 2012 1/ 37 Outline 1 Sensitivity and Robustness 2 Analyzing the sensitivity : the case of Backfilling
More informationINF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)
INF2270 Spring 2010 Philipp Häfliger Summary/Repetition (1/2) content From Scalar to Superscalar Lecture Summary and Brief Repetition Binary numbers Boolean Algebra Combinational Logic Circuits Encoder/Decoder
More informationNCU EE -- DSP VLSI Design. Tsung-Han Tsai 1
NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1 Multi-processor vs. Multi-computer architecture µp vs. DSP RISC vs. DSP RISC Reduced-instruction-set Register-to-register operation Higher throughput by using
More information2IN35 VLSI Programming Lab Work Communication Protocols: A Synchronous and an Asynchronous One
2IN35 VLSI Programming Lab Work Communication Protocols: A Synchronous and an Asynchronous One René Gabriëls, r.gabriels@student.tue.nl July 1, 2008 1 Contents 1 Introduction 3 2 Problem Description 3
More informationThe Underlying Semantics of Transition Systems
The Underlying Semantics of Transition Systems J. M. Crawford D. M. Goldschlag Technical Report 17 December 1987 Computational Logic Inc. 1717 W. 6th St. Suite 290 Austin, Texas 78703 (512) 322-9951 1
More informationVerification of a Dynamic Channel Model using the SPIN Model Checker
Verification of a Dynamic Channel Model using the SPIN Model Checker Rune Møllegaard FRIBORG a,1 and Brian VINTER b a escience Center, University of Copenhagen b Niels Bohr Institute, University of Copenhagen
More informationComplex Systems Design & Distributed Calculus and Coordination
Complex Systems Design & Distributed Calculus and Coordination Concurrency and Process Algebras: Theory and Practice Francesco Tiezzi University of Camerino francesco.tiezzi@unicam.it A.A. 2014/2015 F.
More informationAnalyzing Contention and Backoff in Asynchronous Shared Memory
Analyzing Contention and Backoff in Asynchronous Shared Memory ABSTRACT Naama Ben-David Carnegie Mellon University nbendavi@cs.cmu.edu Randomized backoff protocols have long been used to reduce contention
More informationSeeking Fastness in Multi-Writer Multiple- Reader Atomic Register Implementations
ΚΥΠΡΙΑΚΗ ΔΗΜΟΚΡΑΤΙΑ ΕΥΡΩΠΑΪΚΗ ΕΝΩΣΗ Η ΔΕΣΜΗ 29- ΣΥΓΧΡΗΜΑΤΟΔΟΤΕΙΤΑΙ ΑΠΟ ΤΗΝ ΚΥΠΡΙΑΚΗ ΔΗΜΟΚΡΑΤΙΑ ΚΑΙ ΤΟ ΕΥΡΩΠΑΪΚΟ ΤΑΜΕΙΟ ΠΕΡΙΦΕΡΕΙΑΚΗΣ ΑΝΑΠΤΥΞΗΣ ΤΗΣ ΕΕ Seeking Fastness in Multi-Writer Multiple- Reader Atomic
More informationarxiv: v1 [cs.dc] 26 Nov 2018
The SNOW Theorem Revisited Kishori M Konwar, Wyatt Lloyd, Haonan Lu, Nancy Lynch November 27, 2018 arxiv:1811.10577v1 [cs.dc] 26 Nov 2018 Abstract In highly-scalable storage systems for Web services, data
More informationAgreement algorithms for synchronization of clocks in nodes of stochastic networks
UDC 519.248: 62 192 Agreement algorithms for synchronization of clocks in nodes of stochastic networks L. Manita, A. Manita National Research University Higher School of Economics, Moscow Institute of
More informationA 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 informationClock-driven scheduling
Clock-driven scheduling Also known as static or off-line scheduling Michal Sojka Czech Technical University in Prague, Faculty of Electrical Engineering, Department of Control Engineering November 8, 2017
More informationNontrivial and Universal Helping for Wait-Free Queues and Stacks
Nontrivial and Universal Helping for Wait-Free Queues and Stacks Hagit Attiya 1, Armando Castañeda 2, and Danny Hendler 3 1 Technion 2 UNAM 3 BGU Abstract This paper studies two approaches to formalize
More informationSolutions to the second midterm. COSC 4330/6310 Summer 2013
Solutions to the second midterm COSC 4330/6310 Summer 2013 First question Consider the following set of parameters for a System V Release 4 scheduler: #ts_quantum ts_tqexp ts_slpret ts_maxwait ts_lwait
More informationSimple 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 informationAutomatic Synthesis of Distributed Protocols
Automatic Synthesis of Distributed Protocols Rajeev Alur Stavros Tripakis 1 Introduction Protocols for coordination among concurrent processes are an essential component of modern multiprocessor and distributed
More informationValency Arguments CHAPTER7
CHAPTER7 Valency Arguments In a valency argument, configurations are classified as either univalent or multivalent. Starting from a univalent configuration, all terminating executions (from some class)
More informationUML. 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 informationStochastic Models of Manufacturing Systems
Stochastic Models of Manufacturing Systems Ivo Adan Systems 2/49 Continuous systems State changes continuously in time (e.g., in chemical applications) Discrete systems State is observed at fixed regular
More informationDesign and Analysis of Distributed Interacting Systems
Design and Analysis of Distributed Interacting Systems Organization Prof. Dr. Joel Greenyer April 11, 2013 Organization Lecture: Thursdays, 10:15 11:45, F 128 Tutorial: Thursdays, 13:00 13:45, G 323 first
More informationCoordination. 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