Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.

Similar presentations


Presentation on theme: "Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the."— Presentation transcript:

1 Hwajung Lee

2  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the implementation details from observers who view the system at a higher level.  Results derived from an abstract model is applicable to a wide range of platforms.

3  System topology is a graph G = (V, E), where V = set of nodes (sequential processes) E = set of edges (links or channels, bi/unidirectional)  Four types of actions by a process:  Internal action  Communication action  Input action  Output action

4 Axiom 1. Message m sent  message m received Axiom 2. Message propagation delay is arbitrary but finite. Axiom 3. m1 sent before m2  m1 received before m2. P Q

5 Send & receive can be blocking or non-blocking Postal communication is asynchronous: Telephone communication is synchronous Synchronous clocks Physical clocks are synchronized Synchronous processes Lock-step synchrony Synchronous channels Bounded delay Synchronous message-order First-in first-out channels Synchronous communication Communication via handshaking Any restriction defines some form of synchrony …

6 Address spaces of processes overlap M1M1 13 2 4 M2M2 Concurrent operations on a shared variable are serialized

7 0 3 2 1 State reading model Each process can read the states of its neighbors 0 3 21 Link register model Each process can read from and write to adjacent registers. The entire local state is not shared.

8  Communication via broadcast  Limited range  Dynamic topology

9  Mobile agent  a program code that migrates from one process to another  Can interact with the variables of programs running on the host machine, use its resources, and take autonomous routing decisions.  Strong mobility/weak mobility  Ex.: Dartmouth’s D’Agents, IBM’s Aglets

10  Model: (I, P, and B)  I is the agent identifier and is unique for every agent.  P designates the agent program  B is the briefcase and represent the data variables to be used by the agent

11 One object (or operation) of a strong model = More than one objects (or operations) of a weaker model. Often, weaker models are synonymous with fewer restrictions. One can add layers (additional restrictions) to create a stronger model from weaker one. Examples HLL model is stronger than assembly language model. Asynchronous is weaker than synchronous. Bounded delay is stronger than unbounded delay (channel)

12 Stronger models - simplify reasoning, but - needs extra work to implement Weaker models - are easier to implement. - Have a closer relationship with the real world “Can model X be implemented using model Y?” is an interesting question in computer science. Sample problems Non-FIFO to FIFO channel Message passing to shared memory Non-atomic broadcast to atomic broadcast Complicated Simple

13 P Q buffer m1m4m3m2

14 {Sender process P}{Receiver process Q} var i : integer {initially 0} var k : integer {initially 0} buffer: buffer [0..∞] of msg {initially  k: buffer [k] = empty repeatrepeat {STORE} send m[i],i to Q; receive m[i],i from P; i := i+1 store m[i] into buffer[i]; forever {DELIVER} while buffer[k] ≠ empty do begin deliver content of buffer [k]; buffer [k] := empty; k := k+1; end forever

15 (a) Needs Unbounded sequence numbers and (b) Unbounded number of buffer slots  Both are bad Now solve the same problem on a model where (a) The propagation delay has a known upper bound of T. (b) The messages are sent out @r per unit time. (c) The messages are received at a rate faster than r.  The buffer requirement drops to (r xT). Thus, Synchrony pays. Question. How to solve the problem using bounded buffer space if the propagation delay is arbitrarily large?

16 {Read X by process i } : read x[i] {Write X:= v by process i } - x[i] := v ; - Atomically broadcast v to every other process j (j ≠ i); - After receiving broadcast, process j (j ≠ i) sets x[j] to v. Understand the significance of atomic operations. It is not trivial, but is very important in distributed systems This is incomplete. There are more pitfalls here.

17 Atomic broadcast = either everybody or nobody receives {process i is the sender} for j = 1 to N-1 (j ≠ i) send message m to neighbor[j] (Easy!) Now include crash failure as a part of our model. What if the sender crashes at the middle? Implement atomic broadcast in presence of crash.

18 Communicates via messengers instead of (or in addition to) messages. What is the lowest Price of an iPod in Radford? Carries both program and data

19 Reactive vs Transformational systems A reactive system never sleeps (like: a server or servers) A transformational (or non-reactive systems) reaches a fixed point after which no further change occurs in the system (Examples?) Named vs Anonymous systems In named systems, process id is a part of the algorithm. In anonymous systems, it is not so. All are equal. (-) Symmetry breaking is often a challenge. (+) Easy to switch one process by another with no side effect. Saves log N bits.

20 Many measures o Space complexity o Time complexity o Message complexity o Bit complexity o Round complexity What do these mean? Consider broadcasting in an n-cube (n=3) source

21 {Process 0} sends m to neighbors {Process i > 0} repeat receive m {m contains the value } ; if m is received for the first time then x[i] := m.value ; send x[i] to each neighbor j > I else discard m end if forever What is the (1) message complexity (2) space complexity per process? Each process j has a variable x[j] initially undefined

22 {Process 0} x[0] := v {Process i > 0} repeat if  a neighbor j < i : x[i] ≠ x[j] then x[i] := x[j] {this is a step} else skip end if forever What is the time complexity? (i.e. how many steps are needed?) Can be arbitrarily large! WHY? Each process j has a variable x[j] initially undefined

23 Now, use “large atomicity”, where in one step, a process j reads the states of ALL its neighbors of smaller id, and updates x[j] only when these are equal, and different from x[j]. What is the time complexity? How many steps are needed? The time complexity is now O(n 2 ) Each process j has a variable x[j] initially undefined

24 Rounds are truly defined for synchronous systems. An asynchronous round consists of a number of steps where every process (including the slowest one) takes at least one step. How many rounds will you need to complete the broadcast using the large atomicity model? Each process j has a variable x[j] initially undefined


Download ppt "Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the."

Similar presentations


Ads by Google