Modelling III: Asynchronous Shared Memory Model Chapter 9 by Nancy A. Lynch presented by Mark E. Miyashita.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Global States.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
Chapter 7 - Local Stabilization1 Chapter 7: roadmap 7.1 Super stabilization 7.2 Self-Stabilizing Fault-Containing Algorithms 7.3 Error-Detection Codes.
Lecture 8: Three-Level Architectures CS 344R: Robotics Benjamin Kuipers.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Termination Detection of Diffusing Computations Chapter 19 Distributed Algorithms by Nancy Lynch Presented by Jamie Payton Oct. 3, 2003.
Interface Automata 29-September Modeling Temporal Behavior of Component Component behaves with Environment Traditional (pessimistic) approach –
IS 1181 IS 118 Introduction to Development Tools VB Chapter 06.
An Introduction to Input/Output Automata Qihua Wang.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Impossibility of Distributed Consensus with One Faulty Process Michael J. Fischer Nancy A. Lynch Michael S. Paterson Presented by: Oren D. Rubin.
Chapter 2: Design of Algorithms
Slides prepared by Rose Williams, Binghamton University Chapter 6 Arrays.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 20 Datapath and Control Datapath - performs data transfer and processing operations.
SE-565 Software System Requirements More UML Diagrams.
Chapter 8 Asynchronous System Model by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
REPETITION STRUCTURES. Topics Introduction to Repetition Structures The while Loop: a Condition- Controlled Loop The for Loop: a Count-Controlled Loop.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Domain testing Tor Stålhane. Domain testing revisited We have earlier looked at domain testing as a simple strategy for selecting test cases. We will.
Operating Systems.  Operating System Support Operating System Support  OS As User/Computer Interface OS As User/Computer Interface  OS As Resource.
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part Two.
Systems Analysis and Design in a Changing World, 6th Edition
Chapter 14 Asynchronous Network Model by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
DISTRIBUTED ALGORITHMS By Nancy.A.Lynch Chapter 18 LOGICAL TIME By Sudha Elavarti.
PARTIALLY SYNCHRONOUS ALGORITHMS PRESENTED BY: BINAMRA DUTTA.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
Consensus with Partial Synchrony Kevin Schaffer Chapter 25 from “Distributed Algorithms” by Nancy A. Lynch.
1 Chapter 9 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 7: BPEL Some notes selected from.
Timed I/O Automata: A Mathematical Framework for Modeling and Analyzing Real-Time Systems Frits Vaandrager, University of Nijmegen joint work with Dilsun.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
1 Structuring Systems Requirements Use Case Description and Diagrams.
6.852: Distributed Algorithms Spring, 2008 Class 13.
 C-style pointer-based arrays  Have great potential for errors and several shortcomings  C++ does not check whether subscripts fall outside the range.
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.5 Application: Correctness of Algorithms 1 [P]rogramming reliability – must be an activity.
Agenda Fail Stop Processors –Problem Definition –Implementation with reliable stable storage –Implementation without reliable stable storage Failure Detection.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
Chapter 3 System Performance and Models Introduction A system is the part of the real world under study. Composed of a set of entities interacting.
JavaScript, Fourth Edition
Chapter 4: Elementary Number Theory and Methods of Proof 4.8 Application: Algorithms 1 Begin at the beginning…and go on till you come to the end: then.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
Systems Analysis and Design in a Changing World, Fourth Edition
Algorithmic state machines
Datapath - performs data transfer and processing operations The control unit sends: – Control signals – Control outputs The control unit receives: – External.
Impossibility of Distributed Consensus with One Faulty Process By, Michael J.Fischer Nancy A. Lynch Michael S.Paterson.
Fall 2008Programming Development Techniques 1 Topic 20 Concurrency Section 3.4.
Chapter 8 Asynchronous System Model by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Review n System dynamics : A sequence of state transition n model : A set of rules for state transition System S X Y Discrete event system FSM (Automata)
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
An algorithm of Lock-free extensible hash table Yi Feng.
1/20 Arrays Changki PSWLAB Arrays Daniel Kroening and Ofer Strichman Decision Procedure.
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
1 Chapter 11 Global Properties (Distributed Termination)
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Govt. Engineering College- Gandhinagar. It is all about……  STATE MACHINE.
Fundamentals of Fault-Tolerant Distributed Computing In Asynchronous Environments Paper by Felix C. Gartner Graeme Coakley COEN 317 November 23, 2003.
1 Seminar on SOA Seminar on Service Oriented Architecture BPEL Some notes selected from “Business Process Execution Language for Web Services” by Matjaz.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Distributed Systems Lecture 6 Global states and snapshots 1.
Copyright © Cengage Learning. All rights reserved.
Control Structure Senior Lecturer
CIS16 Application Development and Programming using Visual Basic.net
Distributed systems Consensus
Presentation transcript:

Modelling III: Asynchronous Shared Memory Model Chapter 9 by Nancy A. Lynch presented by Mark E. Miyashita

Introduction Shared Memory System Environment Model Shared Variable Types Failures Organization

Introduction The model is presented in terms of the general I/O automaton model for asynchronous systems as defined from the previous chapter As oppose to previous chapter where sending and receiving messages over communication channels, a shared memory system consists of a collection of communicating processes performing instantaneous operations on shared variables

Shared Memory System Informally, an asynchronous memory system consists of a finite collection of processes interacting with each other by means of a finite collection of shared variables These variables are used only for communication among the processes in the system Assume in this model that each process has a port which can interact with outside world (environment) using input and output actions The model consists of single I/O automaton with its external interface consisting of the input and output actions on all the ports It does not use several automata for one per process and one per shared variables

Shared Memory System portsprocessesShared variables 1 2 n Figure 9.1: An asynchronous shared memory system 1 2 n

Shared Memory System Why? Using I/O automaton composition, resulting system obtained will have operation by a process ì on a shared variable x would be modelled by a pair of events – invocation and response One of the possible executions could be an invocation that is an output of process ì and an input of variable x, followed by a response that is an output of variable x and an input of process ì Another possible executions can split these pair of events – several operations could be invoked before the first of them returning Avoiding issues above by modelling the entire system as one big I/O automaton A which captures the process and variable structure within A

Shared Memory System Assume shared memory system consisting of n processes numbered 1,….,n Assume each process ì has an associated set of states, states i, among which some are designated as the start states, start i Assume each shared variable x in the system has an associated values, values x, among which some are designated as the initial values, initial x Each state in state(A) consists of a state in states i for each process ì and a value in values x for each shared variable x Each state in start(A) consists of a state in start i for each process ì and a value in initial x for each shared variable x

Shared Memory System Assume each action in acts(A) is associated with one of the process Int(A) may be associated with a shared variables – two cases to consider –Both input and output actions associated with process ì are used for both interactions between process ì and outside world (occur on port ì); shared variable x is used for performing operations on x –Processes ì without associated shared variables are used for internal computation

Shared Memory System The set tans(A) of transitions has some locality restrictions with two cases to consider as int(a) –An action  that is associated with process ì without variable (local computation) – only the state of ì can be involved in any  step – the set of triples of form (s, , s’), where s, s’  states i –An action  that is associated with both process ì and a variable x (  is used by ì to perform operation on x) - only the state of ì and value of x can be involved in any  step – the set of triples of form ((s,v), , (s’,v’)), where s,s’  states i and v,v’  values x

Shared Memory System States of ì: Status  {idle,access,decide,done}, initially idle Input  V  {unknown}, initially unknown Output  V  {unknown}, initially unknown Transitions of ì: Init(v) ì decide(v) ì Effect: Precondition: input := v status = decide if status = idle then status := access output = v access ì Effect: Precondition: status := done status = access Effect: if x = unknown then x := input output := x status := decide

Shared Memory System Let P be the trace property such that sig(P) = extsig(P) and trances(P) is the set of sequences  of actions in acts(P) satisfying 1.For any ì, if exactly one init ì event appears in , then exactly one decide ì event appears in  2.For any ì, if no init ì event appears in , then no decide ì event appears in  3.(Agreement) If decide(v) ì and decide(w) j both appear in , then v=w 4.(Validity) if a decide(v) ì appears in , then some init(v) j event (for the same v) appears in 

Environment model It model the environment of a system as an automaton in addition to previous example It allows way to describe assumptions about the environment’s behavior For practical shared memory system, the environment can be described as a collection of independent user automaton, one per port Extending the previous example, the environment is a single I/O automaton that is composed of one user automaton U ì, for each process index ì

portsprocessesShared variables 1 2 n init(v) 1 Environment model x decide(v) 1 U1U1 U2U2 UnUn users

Environment model Signature: Input: decide(v) ì, v  V Internal: dummy ì Output: init(v) ì, v  V States: Status  {request,wait,done}, initially request Decision  V  {unknown}, initially unknown error, a boolean, initially false Transitions: Init(v) ì decide(v) ì Precondition: Effect: status = request or error = true if error = false then Effect: if status = wait then if error = false then status := wait decision := v status := done dummy ì else error := true Precondition: error = true Effect: none

Environment model Let Q be the trace property such that sig(Q) consists of output init(v) ì and decide(v) ì for all ì and v, and trances(Q) is the set of sequences  of actions in acts(Q) satisfying 1.For any ì,  contains exactly one init ì event follow by exactly one decide ì event 2.(Agreement) If decide(v) ì and decide(w) j both appear in , then v=w 3.(Validity) if a decide(v) ì appears in , then some init(v) j event (for the same v) appears in 

Shared Variable Types A variable type consists of (what it means of shared memory system A to observe type restrictions) a set V of values an initial value v 0  V a set of invocations a set of response a function f: invocation x V  responses x V The function f indicates when a given invocation arrives at the variable and the variable has a given value; f describes the new value the variable assigned and the response that is returned The invocations and responses are thought of as occurring together as part of one function as oppose to the input/outputs actions of I/O automaton model are separate

Shared Variable Types For each process ì and invocation a, the set of transitions involving ì and a must be describable in the form where p is some predicate on state ì and g is some relation: g  state ì x response x state ì Transition involving ì and a Precondition: p(state ì ) Effect: (b,x) := f(a,x) state ì := any s such that (state ì,b,s)  g The function f for the variable type is applied to the invocation a and the value of variable x to determine a response b and a new value for x

Read/Write Shared Variable Most frequently used variable type in multiprocessors is one supporting only read and write operations Invocations are read and write(v), v  V Responses are v  V and ack Function f : f(read,v) = (v,v) and f(write(v),w) = (ack, v) Rewriting algorithm of Example by separating each access into a read and write step The status value access is replaced by two new status values, read and write

Read/Write Shared Variable Transitions: Init(v) ì decide(v) ì Effect: Precondition: input := v status = decide if status = idle then status := read output = v read ì Effect: Precondition: status := done status = read Effect:write(v) ì if x = unknown then Precondition: output := input status = write status := write v = input else Effect: output := x x := v status := decide status := decide

Read/Write Shared Variable Re-writing code in terms of a predicate p and a relation g; read ì action p is simply “status = read” relation g is the set of triplets (s,b,s’)  state ì x (V  {unknown}) x state ì s’ is obtained from s by the code if b = unknown then output := input status := write else output := b status := decide write(v) ì action p is simply “status = write and v = input” relation g is the set of triplets (s,b,s’)  state ì x (V  {unknown}) x state ì s’ is obtained from s by the code status := decide

Read-modify-write Shared Variable One instantaneous read-modify-write operation on a shared variable x, a process ì can do all of the following: 1.Read x 2.Carry out some computation, possible using the value of x, that modifies the state of ì and determines a new value for x 3.Write the new value to x The function h used as an invocation of the variable, it provides the information from the process’s state that is needed to determine the transition, expressed in the form of a function to apply to the variable Its invocation are all the functions h, where h: V  V Its responses are v  V Function f: f(h,v)= (v,h(v)) – it responds with prior value and updates its values based on the submitted function

Read-modify-write Shared Variable Example 9.1.1, the function submitted by a process to the variable is of the form h v where v, if x = unknown h v (x) = x, otherwise h v submitted by a process uses the process’s input as the value of v A return value of unknown cases input to be set to the value of output A return value of v  V causes output to be set to v

Other Variable types Compare-and-swap Invocation are of the form compare-and-swap(u,v), u,v,  V Responses are elements of V Function f is defined as: (w,v), if u=w f(compare-and-swap(u,v),w) = (w,w), otherwise If the variable’s value is equal to the first argument u, then operation resets it to the second argument v; otherwise operation does not change the value of variable Swap Invocation are the form swap(u), u  V Responses are elements of V Function f is defined as: f(swap(u),v) = (v,u) – write input value u into variable and returns original variable value v

Other Variable types test-and-set Invocation are of the form test-and-set Responses are elements of V (assume 1  V) Function f is defined as: f(test-and-set,v = (v,1) The operation writes 1 into the variable and returns the original value v Fetch-and-add Invocation are the form fetch-and-add(u), u  V Responses are elements of V Function f is defined as: f(fetch-and-add(u),v) = (v,v+u) The operation adds the input value u to the variable value v and returns the original value v

Failures portsprocessesShared variables n 2 n stop n a stop ì (input action) event can change only the state of process ì, disable all the tasks of process ì Effect of such state changes never be communicated to any other process