Asynchronous Components Asynchronous communications: from calculi to distributed components.

Slides:



Advertisements
Similar presentations
Elton Mathias and Jean Michael Legait 1 Elton Mathias, Jean Michael Legait, Denis Caromel, et al. OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis,
Advertisements

Global States.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
Lecture 8: Asynchronous Network Algorithms
European Commission Directorate-General Information Society Unit F2 – Grid Technologies INSERT PROJECT ACRONYM HERE BY EDITING THE MASTER SLIDE (VIEW.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Denis Caromel1 Joint work with Ludovic Henrio – Eric Madelaine et. OASIS members OASIS Team INRIA -- CNRS - I3S – Univ. of Nice Sophia-Antipolis, IUF.
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
Introduction To System Analysis and Design
Session 2: task 3.2 GCM, Kracow, June l Current status of GCM Denis Caromel (10 mn each talk) l Wrapping CCA Components as GCM Components Maciej.
Ordering and Consistent Cuts Presented By Biswanath Panda.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
Concurrency CS 510: Programming Languages David Walker.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory for SSCC Joint work with Luis Cruz-Filipe, Francisco Martins,
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
Constructing Reliable Software Components Across the ORB M. Robert Rwebangira Howard University Future Aerospace Science and Technology.
1 Ivan Lanese Computer Science Department University of Bologna Italy Behavioural Theory at Work: Program Transformations in a Service-centred Calculus.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Inter-process Communication and Coordination Chaitanya Sambhara CSC 8320 Advanced Operating Systems.
Safe composition of distributed adaptable components A distributed component model Behavioural specification and verification Ludovic Henrio and Eric Madelaine.
Oct Multi-threaded Active Objects Ludovic Henrio, Fabrice Huet, Zsolt Istvàn June 2013 –
The Grid Component Model: an Overview “Proposal for a Grid Component Model” DPM02 “Basic Features of the Grid Component Model (assessed)” -- DPM04 CoreGrid.
Oct Active objects: programming and composing safely large-scale distributed applications Ludovic Henrio SCALE team, CNRS – Sophia Antipolis July.
The Grid Component Model and its Implementation in ProActive CoreGrid Network of Excellence, Institute on Programming Models D.PM02 “Proposal for a Grid.
Introduction To System Analysis and Design
1 Update Strategies for First Class Futures Khan Muhammad, Ludovic Henrio INRIA, Univ. Nice Sophia Antipolis,CNRS.
Formalism and Platform for Autonomous Distributed Components Bio-inspired Networks and Services A Distributed Component Model Formalisation in Isabelle.
Workflow Early Start Pattern and Future's Update Strategies in ProActive Environment E. Zimeo, N. Ranaldo, G. Tretola University of Sannio - Italy.
Eric MadelaineOSMOSE -- WP2 -- Prague June 2004 Models for the Verification of Distributed Java Objects Eric Madelaine work with Tomás Barros, Rabéa Boulifa,
1 M. Tudruj, J. Borkowski, D. Kopanski Inter-Application Control Through Global States Monitoring On a Grid Polish-Japanese Institute of Information Technology,
Programming Paradigms for Concurrency Pavol Cerny Vasu Singh Thomas Wies Part III – Message Passing Concurrency.
Asynchronous Components with Futures: Semantics, Specification, and Proofs in a Theorem Prover Components (Distributed) Futures Formalisations (and proofs)
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Behavioural Verification of Distributed Components Ludovic Henrio and Eric Madelaine ICE Florence 1.
Behavioural Verification of Distributed Components Ludovic Henrio and Eric Madelaine ICE
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © GridCOMP Grids Programming with components.
Structural Design Patterns
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © 2006 GridCOMP Grids Programming with components. An.
1. 2 Objects to Distributed Components (1) Typed Group Java or Active Object ComponentIdentity Cpt = newActiveComponent (params); A a = Cpt ….getFcInterface.
A Component Platform for Experimenting with Autonomic Composition A component framework for supporting composition of autonomic services and bio-inspired.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
ASPfun: A Distributed Object Calculus and its Formalization in Isabelle Work realized in collaboration with Florian Kammüller and Henry Sudhof (Technische.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
A visualisation and debugging tool for multi-active objects Ludovic Henrio, Justine Rochas LAMHA, Nov 2015.
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Transparent First-class Futures and Distributed Components Introduction: components, futures, and challenges Statically Representing Futures An Example.
Eric MADELAINE1 A. Cansado, L. Henrio, E. Madelaine OASIS Team, INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis Fractal workshop, Nantes, 3 july.
Specifying Fractal and GCM Components With UML Solange Ahumada, Ludovic Apvrille, Tomás Barros, Antonio Cansado, Eric Madelaine and Emil Salageanu SCCC.
Distributed Components and Futures: Models and Challenges A Distributed Component Model Distributed Reconfiguration Calculi for Components and Futures.
A Theory of Distributed Objects Toward a Foundation for Component Grid Platforms Ludovic HENRIO l A Theory of Distributed Objects l Components l Perspectives.
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Parallel and Distributed Simulation Deadlock Detection & Recovery: Performance Barrier Mechanisms.
Parallel and Distributed Simulation Deadlock Detection & Recovery.
2. CALCULUS: A S P. A Theory of Distributed Objects D. Caromel, L. Henrio, Springer 2005, Monograph A Calculus: ASP: Asynchronous Sequential Processes.
Distributed Systems Lecture 6 Global states and snapshots 1.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Asynchronous Distributed Components: Concurrency and Determinacy I. Context: Distributed Components and Active Objects II. Asynchronous Distributed Components.
TensorFlow– A system for large-scale machine learning
Distributed Shared Memory
Distributed Components and Futures: Models and Challenges
COT 5611 Operating Systems Design Principles Spring 2012
DISTRIBUTED COMPUTING
EEC 688/788 Secure and Dependable Computing
Indirect Communication Paradigms (or Messaging Methods)
Indirect Communication Paradigms (or Messaging Methods)
The Grid Component Model and its Implementation in ProActive
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

Asynchronous Components Asynchronous communications: from calculi to distributed components

Synchronous and asynchronous languages Systems build from communicating components : parallelism, communication, concurrency Asynchronous Processes  Synchronous communications (rendez-vous)  Asynchronous communications (message queues) Synchronous Processes (instantaneous diffusion) Question on D. Caromel course: how do you classify ProActive ? 2 Process calculi: CCS, CSP, Lotos SDL modelisation of channels Esterel, Sync/State-Charts, Lustre

Asynchrony in CCS

Processes Calculi – what is asynchrony? A proposal in π-calculus: Asynchronous π-calculus No consequence of output actions Equivalent in CCS:

Processes Calculi – what is asynchrony? (2) μ.P can be a.P, a.P, τ.P An asynchronous version would be to allow only a.P, and τ.P, and simply a without suffix a.P has to be replaced by (a|P) A very simple notion but sufficient at this level Same expressivity, but simple synchronisation can become more complex

Communication Ordering; A Deeper Study Synchronous, asynchronous, and causally ordered communication Bernadette Charron–Bost, Friedemann Mattern, Gerard Tel 1996

Causality Violation Causality violation occurs when order of messages causes an action based on information that another host has not yet received. P1 P2 P Physical Time 4 6

The “triangle pattern” A C B 2 1 (e.g., init) 3 Objective: Ensure that 3 arrive at C after 1.

Mattern: Communication is not only synchronous or asynchronous asynchronous communications, any order is valid (provided messages are received after being sent)  Γ(s,r)  Γ a communication ≺ i local causality relation (total order on events) Global causality ≺,verifies at least a ≺ i b ⇒ a ≺ b  Γ s ≺ r (if (s,r)  Γ) + transitivity If ≺ is a partial order (antisymetric) then it represents a valid asynchronous communication i.e. there must be no cycle of different events If ≺ is a partial order (antisymetric) then it represents a valid asynchronous communication i.e. there must be no cycle of different events

Synchronous communication Emission and reception is almost the same event A first characterization: Additionally  Γ, then as ar and ra sa (still no cycle) – strong common past, strong common futureA first characterization: Additionally if (s,r)  Γ, then a ≺ s ⇒ a ≺ r and r ≺ a ⇒ s ≺ a (still no cycle) – strong common past, strong common future Or : messages can be all drawn vertically at the same timeOr : messages can be all drawn vertically at the same time OR: no crownOR: no crown (s1 r2 and s2 r3 and … sn r1) (s1 ≺ r2 and s2 ≺ r3 and … sn ≺ r1)

FIFO Order of messages sent between two given processes is guaranteed (reception order is the sending order) Let a~b if and b on the same process  Γ,  Γ, s~s’ and r~r’ then ss’ rr’ (still no cycle)Asynchronous + if (s,r)  Γ, (s’,r’)  Γ, s~s’ and r~r’ then s ≺ s’ ⇒ r ≺ r’ (still no cycle)

Causal Ordering More general than FIFO  Γ,  Γ, and r~r’ then ss’ rr’ (still no cycle)Asynchronous + if (s,r)  Γ, (s’,r’)  Γ, and r~r’ then s ≺ s’ ⇒ r ≺ r’ (still no cycle) A nice characterization: for each message the diagram can be drawn with m as a vertical arrow and no other message go backwardA nice characterization: for each message the diagram can be drawn with m as a vertical arrow and no other message go backward

Applications Such characterizations are useful for  Identifying coherent states (states that could exist)  Performing fault-tolerance and checkpointing  Study which algorithms are applicable on which communication orderings  Might be useful for debugging, or replaying an execution

A “few” communication orderings Synchronous FIFO channels Causal ordering Synchronous What is rendez-vous? What does rendez-vous ensure? So why is ProActive said asynchronous? No event beteen sending and reception

GCM: “Asynchronous” Fractal Components

GCM – Quick Context Designed in the CoreGrid Network of Excellence, Implemented in the GridCOMP European project Add distribution to Fractal components OUR point of view in OASIS:  No shared memory between components  Components evolve asynchronously  Components are implemented in ProActive  Communicate by request/replies (Futures) A good context for presenting asynchronous components futures and many-to-many communications

What are (GCM/Fractal) Components? Bindings Business code Server interfaces Client interfaces Primitive component Composite component NF (server) interfaces

A Primitive GCM Component CI.foo(p) Primitive components communicating by asynchronous remote method invocations on interfaces (requests)  Components abstract away distribution and concurrency in ProActive components are mono-threaded  simplifies concurrency but can create deadlocks

Composition in GCM Bindings: Requests = Asynchronous method invocations

Futures for Components f=CI.foo(p) ………. f.bar() Component are independent entities (threads are isolated in a component) + Asynchronous method invocations with results  Futures are necessary

Replies f=CI.foo(p) ……………… f.bar()

First-class Futures f=CI.foo(p) ……………… CI.foo(f) Only strict operations are blocking (access to a future) Communicating a future is not a strict operation

First-class Futures and Hierarchy Without first-class futures, one thread is systematically blocked in the composite component. f=f’

First-class Futures and Hierarchy … … … Almost systematic dead-lock in ProActive A lot of blocked threads otherwise

Reply Strategies In ASP / ProActive, the result is insensitive to the order of replies (shown for ASP-calculus) experiments with different strategies

delta.send(result) result.bar()    Future Update Strategies  4 – Implementation Strategies Part V

delta.send(result)result.bar()    Future Update Strategies: Message-based  4 – Implementation Strategies Future Forwarded Messages Part V

delta.send(result)result.bar()    Future Update Strategies: Forward-based  4 – Implementation Strategies Part V

delta.send(result)result.bar()    Future Update Strategies: Lazy Future Updates  4 – Implementation Strategies Part V

A Distributed Component Model with Futures Primitive components contain the business code Primitive components act as the unit of distribution and concurrency (each thread is isolated in a component) Communication is performed on interfaces and follows component bindings Futures allow communication to be asynchronous requests Futures are transparent can lead to optimisations and are a convenient programming abstraction but …

What Can Create Deadlocks? A race condition: Detecting deadlocks can be difficult  behavioural specification and verification techniques (cf Eric Madelaine)

Collective Communications Communications are not necessarily one-to-one: One-to-many Many-to-One M by N

Collective Communications Simple type system Component type = types of its interfaces Interface type :  Name  Signature  Role  Contingency  Cardinality extended to support multicast / gathercast Fractal type-system

Multicast interfaces Transform a single invocation into a list of invocations Multiple invocations  Parallelism  Asynchronism  Dispatch Data redistribution (invocation parameters)  Parameterisable distribution function  Broadcast, scattering  Dynamic redistribution (dynamic dispatch) Result = list of results

Ordering and Multicast FIFO ordering: If a correct process issues multicast(i,m) and then multicast(i,m’), then every correct process that delivers m’ will deliver m before m’. Causal ordering: If multicast(i,m) precedes multicast(i’,m’) with i abd i’ containing the same elements then any correct process that delivers m’ will deliver m before m’. Totally ordering (determinism): If a correct process delivers message m before m’, then any other correct process that delivers m’ will deliver m before m’.

Gathercast interfaces Transform a list of invocations into a single invocation Synchronization of incoming invocations  ~ “join” invocations  Timeout / drop policy  Bidirectional bindings (callers  callee) Data gathering Aggregation of parameters into lists Redistribution of results Redistribution function

Collective interfaces Specific API  manage collective interfaces and reconfigure them (add client, change policy, …) è Allow MxN communications: Redistribution and direct communications for many-to-many communications

The MxN Problem (1)

The MxN Problem (2)

The MxN Problem (3)

The MxN Problem (4): data distribution

Summary of Collective Communications Simple way of specifying collective operations + definition at the level of the interfaces  better for verification and specification Rich high levels spec of synchronisation (especially gathercast) Easier to optimize  The MxN case: synchronisation issues, complex distribution policies avoid bottleneck

A few things we did not cover SPMD programming and Synchronization Barriers, cf gathercast??? Group communications ~ Multicast Purely synchronous models -> Robert de Simone Shared memory models … and a lot of more complex communication models

Conclusion An overview of asynchronism and different communication timings Applied to components with richer language constructs (futures, collective interfaces, …) Still a lot of other distributed computing paradigms exist (Ambient Talk, creol, X10 for example) A formalism for expressing communication ordering

Exercises

Exercise 1: Request queue In CCS with parameters (a value can be a request)  Express a request queue:  Also express 2 simple processes accessing it Same thing in asynchronous CCS (without and with RDV) Request queue !Enqueue(R) ?Dequeue(R) Hint from last course: Reg i = read(i ).Reg i + write(x ).Reg x

Exercise 2: Are the execution CO, synchronous, asynchronous or FIFO?

Exercise 3: find a solution to the deadlock slide 31

Exercise 4: Ensuring causal ordering with a sending queue In the example below, suppose that the bottom thread has a sending queue, that is it sends all messages to an additional thread that emits the final messages.  Draw the new message exchanges  Is causal ordering still ensured?  FIFO ?

Exercise 5: Ensuring causal ordering with many sending queues Same thing but with one sending queue per destination process  Draw the new message exchanges  Is causal ordering still ensured?  FIFO ?