530 likes | 595 Views
Weakly endochronous systems. Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud. Outline. Introduction (the distribution problem) Weakly endochronous systems Applications Weak isochrony Main result Conclusion. module M: input A,B,R; relation A#R,B#R;
E N D
Weakly endochronous systems Dumitru Potop-Butucaru IRISA, France Joint work with A. Benveniste and B. Caillaud
Outline • Introduction (the distribution problem) • Weakly endochronous systems • Applications • Weak isochrony • Main result • Conclusion
module M: input A,B,R; relation A#R,B#R; abort loop await A || await B end when R end module 3 R R A R B 1 0 2 B A A,B
A A B B R input Synchrony • Global clock, reactions • Can test the absence • Composition: • synchronized product (unification on reactions) 3 R R A R B 1 0 2 B A A,B
A A B B R input Asynchrony • No global clock • No reaction, no absence • Composition: • unification of FIFO histories 3 R R A R B 1 0 2 B A A,B
A A A A B B B B R R input Asynchrony • No global clock • No reaction, no absence • Composition: • unification of FIFO histories R A B B A executive Good executions 3 R R A R B 1 0 2 B A A,B
A R R input Asynchrony • No global clock • No reaction, no absence • Composition: • unification of FIFO histories A B B A R executive Bad executions 3 R R A R B 1 0 2 B A A,B
Model • Components = synchronous automatons no causality • Synchronous composition (automaton product) Σ1Σ2 • Desynchronization operator • Asynchronous composition (on traces) a b c d a b c
Model • Correct resynchronization (Benveniste): (L(Σ1Σ2))= (L(Σ1))||(L(Σ2)) • Intuition: • the asynchronous observations do not change when changing FIFO size and delay • Condition on infinite traces…
Previous work • Latency-insensitivity (Carloni et al., 1999) • Hardware-directed (handle long wires) • Use all channels in each reaction (transmit values) • Monoclock – not efficient • Difficult to re-configure the communication scheme • Extension: Singh and Theobald, 2003 • Endo/Isochrony (Benveniste et al., 2000)
Endo/Isochrony • An endochronous component decides itself how to read its inputs • No event-driven, no real concurrency, determinism! • Comparable to Kahn processes (but no causality) • Executive = state machine and blocking reads • A pair of components is isochronous if no incorrect synchronization takes place • Compositionality problem • Endochrony is not compositional • Difficult to generalize isochrony to >2 components
A R R input A B B A R executive Bad executions 3 R R A R B 1 0 2 B A A,B
input What I want • Non-determinism (Event-driven execution) 1 1 0 A B 0 B 0 A 0 R Event-executive 3 R,E=1 R,D=1 R,D=E=1 A,D=0 B,E=0 1 0 2 B,E=0 A,D=0 A,B,D=E=0
Weak endochrony • Independent reactions = non-overlapping, fully commuting • Weak endochrony = allow online re-synchronization in any environment without restricting concurrency between independent reactions: • Choice between non-independent reactions is visible on a channel • Causal ordering of reactions is visible on a channel
Weak endochrony • Non-independent reactions share a common support variable with different value • Non-independent causally ordered reactions share a common variable 3 R,E=1 R,D=1 R,D=E=1 A,D=0 B,E=0 1 0 2 B,E=0 A,D=0 A,B,D=E=0
Weak endochrony axioms r1 r2 • Determinism: ss1, ss2r1=r2 • Commutation: if r1,r2 do not share present values • ss1, ss2s’:ss’ • ss1s2s’:ss2 • Decomposition: if ss1, ss2 and r1, r2 do not share present variables with different values r1 r2 r1r2 r1 r2 r2 r1 r2 s1 r1\r2 r1r2 s’:ss’ r2\r1 s2
Properties • All reactions are composed of atoms • Disjoint atomsin a statefully commute and can be freely combined 3 State 0 atoms: (A,D=0),(B,E=0), (R,D=E=1) State 1 atoms: (B,E=0),(R,E=1) R,E=1 R,D=1 R,D=E=1 A,D=0 B,E=0 1 0 2 B,E=0 A,D=0 A,B,D=E=0
Related models • Mazurkiewicz traces over atoms • The letters are the atoms, disjoint atoms are independent • Normal form • trace equivalence upto commutation of atoms • take at each reaction the maximal reaction (unique) • Confluence for a given history • Tetris-like heaps (gravity => normal form) • Generalization of endochrony, latency-insensitivity
Consequences • Accept concurrency between independent behaviors • non-determinism • support event-driven implementations • Compositionality: Σ1,Σ2 weakly endochronous Σ1Σ2 weakly endochronous
Simpler correctness criterion • (s1,s2)RSS(Σ1Σ2),iΣi(si),i=1,2: 1||2 exists 1,2 are both void traces or Σ1Σ2 can perform a common transition • Still not an online correctness criterion!
Weak isochrony • (s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that • A1||A2 maximal • ai Ai,i=1,2 i reaction in Σi(si), i=1,2 such that • ai i Ai,i=1,2 • 1||2 exists
Correct desynchronization Theorem If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then: (L(Σ1Σ2))= (L(Σ1))||(L(Σ2))
Methodology • Make components weakly endochronous by deciding which signals are missing • Incrementally build communication protocols that insure the weak isochrony • Remove the useless variables created at point (1)
Conclusion • Weak endochrony/isochrony • Compositional • Supports the development of communication protocols that minimize communication • Not yet effective (not efficiently) • No causality • Future: • Define appropriate algorithms • Extend with causality
Weak isochrony • (s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that • A1||A2 maximal • ai Ai,i=1,2 i reaction in Σi(si), i=1,2 such that • ai i Ai,i=1,2 • 1||2 exists
Synchrony and asynchrony • Composition: • Synchronous composition • Asynchronous composition 1 1 Σ1 Σ2 rejected Σ1Σ2: 2 2 1 1 Σ1 Σ2 accepted Σ1||Σ2: 2 2
Desynchronization • Stuttering-invariant synchronous specification, distributed architecture (FIFOs) • Two aspects: • Correct re-synchronization • Causality, full asynchrony 1 1 Σ1 FIFO Σ2 WRONG 2 2 FIFO
Correct resynchronization • Model • labeled synchronous transition systems • synchronous, n-place bidirectional buffers • no causality • Correctness criterion: • the traces accepted with empty buffers do not change from n=0 to n= 1 1 Σ1 Bn Σ2 2 2 Bn
Correct resynchronization • Equivalent formulation (Benveniste): (L(Σ1Σ2))= (L(Σ1))||(L(Σ2)) = desynchronization operator || = composition of asynchronous traces (equality on interface union)
Previous work • Latency-insensitivity (Carloni et al., 1999) • Hardware-directed (handle long wires) • A component reads/emits all its inputs, or none • Monoclock • Endochrony-like extensions (Singh and Theobald, 2003) • Endo/Isochrony (Benveniste et al., 2000)
Endo/Isochrony • An endochronous component decides itself how to read its inputs Kahn!!! • Determinism, no real concurrency • A pair of components is isochronous if non-contradictory reactions can be fully unified • Compositionality problem • Endochrony is not compositional • Difficult to generalize isochrony to >2 components
Weakly endochronous systems • Allow online re-synchronization in any environment without restricting concurrency: • Each computation choice is visible on an interface variable • Causally ordered reactions share a common variable 1 1 0 2 2 1 or 2 0 1 0 2 1 after
Weakly endochronous systems • Example • Not weakly endochronous. module M: input A,B,R; relation A#R,B#R; abort loop await A || await B end when R end module 3 R R A R B 1 0 2 B A A,B
Weakly endochronous systems • Example module M: input A,B,R; relation A#R,B#R; abort loop await A || await B end when R end module 3 R,E=1 R,D=1 R,D=E=1 A,D=0 B,E=0 1 0 2 B,E=0 A,D=0 A,B,D=E=0
Weakly endochronous systems • All reactions are composed of atoms • Disjoint atomsin a statefully commute and can be freely combined • A reaction can be decomposed into its atoms 3 R,E=1 R,D=1 State 0 atoms: (A,D=0),(B,E=0), (R,D=E=1) State 1 atoms: (B,E=0),(R,E=1) R,D=E=1 A,D=0 B,E=0 1 0 2 B,E=0 A,D=0 A,B,D=E=0
Related models • Mazurkiewicz traces over atoms • The letters are the atoms, disjoint atoms are independent • Normal form • trace equivalence upto commutation of atoms • take at each reaction the maximal reaction (unique) • Confluence for a given history • Tetris-like heaps (gravity => normal form) • Generalization of endochrony
Consequences • Accept concurrency between independent behaviors • non-determinism • support event-driven implementations • Normal form • Compositionality: Σ1,Σ2 weakly endochronous Σ1Σ2 weakly endochronous
Simpler correctness criterion • (s1,s2)RSS(Σ1Σ2),iΣi(si),i=1,2: 1||2 exists 1,2 are both void traces or Σ1Σ2 can perform a common transition • Weak endochrony online correctness criterion!
Weak isochrony • (s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that • A1||A2 maximal • ai Ai,i=1,2 i reaction in Σi(si), i=1,2 such that • ai i Ai,i=1,2 • 1||2 exists
Weak isochrony • (s1,s2)RSS(Σ1Σ2), ai atom in Σi(si), i=1,2, Ai reaction in Σi(si) such that • A1||A2 maximal • ai Ai,i=1,2 i reaction in Σi(si), i=1,2 such that • ai i Ai,i=1,2 • 1||2 exists
Correct desynchronization Theorem If Σ1,Σ2 weakly endochronous, (Σ1,Σ2) weakly isochronous then: (L(Σ1Σ2))= (L(Σ1))||(L(Σ2))
Conclusion • Weak endochrony/isochrony • Compositional • Supports the development of communication protocols that minimize communication • Not yet effective (not efficiently) • No causality • Future: • Define appropriate algorithms • Extend with causality
Methodology • Make components weakly endochronous by deciding which signals are missing • Incrementally build communication protocols that insure the weak isochrony • Remove the useless variables created at point (1)
Weakly endochronous systems • Composition • Weak endochrony is compositional • Weak endochrony insures the equivalence between C1 and C2 • Re-synchrhronize a atome pres • Confluence, unique etat pour une histoire donnee
Correct resynchronization • Correctness criterion, revisited: L0(Σ1Σ2B0B0) = L0(Σ1Σ2BB) • Equivalent formulation (Benveniste): (L(Σ1Σ2))= (L(Σ1))||(L(Σ2)) = desynchronization operator || = composition of asynchronous traces (equality on interface union)