500 likes | 661 Views
ASYNCHRONOUS AND DETERMINISTIC OBJECTS. Denis CAROMEL, Ludovic HENRIO , Bernard Paul SERPETTE. ASP: Asynchronous Sequential Processes Distributed objects Asynchronous method calls Futures and Wait-by-necessity Determinism properties. I3S - INRIA - Univ Nice Sophia-Antipolis. Context.
E N D
ASYNCHRONOUS AND DETERMINISTIC OBJECTS Denis CAROMEL, Ludovic HENRIO, Bernard Paul SERPETTE ASP: Asynchronous Sequential Processes Distributed objects Asynchronous method calls Futures and Wait-by-necessity Determinism properties I3S - INRIA - Univ Nice Sophia-Antipolis
Context • V-calculus • Objects, not concurrent • Some concurrent extensions, notour way to determinism • -calculus • Communications, channel based, not object structured • Linear(ized) channels(pobl), no implicit synchronization • Process Networks • Processes, channel based, not object oriented • Determinism, no implicit synchronization Context
Contents • 1 - ASP Principles • 2 - Syntax and Semantics • 3 - Confluence and Determinacy • 4 - Conclusion
a b foo f2 f1 foo g d f3 Structure Active(a) 1- ASP Principles
Sending Requests ( REQUEST ) a b beta.foo(b) foo result=beta.foo(b) 1- ASP Principles
result Sending Requests ( REQUEST ) a b beta.foo(b) foo result=beta.foo(b) 1- ASP Principles
result Serving Requests ( SERVE ) a b Serve(foo);... beta.foo(b) bar foo Serve(foo);... 1- ASP Principles
result foo ... foo Serving Requests ( SERVE ) a b Serve(foo) beta.foo(b) bar Serve(foo);... 1- ASP Principles
End of Service ( ENDSERVICE ) a b value ... foo 1- ASP Principles
End of Service ( ENDSERVICE ) a b ... foo 1- ASP Principles
Sending Results ( REPLY ) a b foo 1- ASP Principles
Sending Results ( REPLY ) a b foo 1- ASP Principles
Wait by Necessity a b delta.send(result) d 1- ASP Principles
result.bar() Wait by Necessity a b delta.send(result) result.bar() d 1- ASP Principles
result.bar() Wait by Necessity a b delta.send(result) result.bar() d 1- ASP Principles
Wait by Necessity a b Futures updates can occur at any time result.bar() d 1- ASP Principles
Contents • 1 - ASP Principles • 2 - Syntax and Semantics • 3 - Confluence and Determinacy • 4 - Conclusion
ASP Syntax : source terms • Imperative V-calculus • ASP parallelism primitives 2- Syntax and Semantics
Service Local Creating Activity Sending request Receiving replies 2- Syntax and Semantics
Contents • 1 - ASP Principles • 2 - Syntax and Semantics • 3 - Confluence and Determinacy • 4 - Conclusion
g b a delta.foo() Compatibility Serves the oldest request on foo OR bar bar d …. Serve(foo,bar) … Serve(foo,gee) foo gee 3- Confluence and Determinacy
P0 P Q R • RSL definition: • Configuration Compatibility: Confluence • Potential services: Execution characterized by the order of Request Senders Compatibility Confluence 3- Confluence and Determinacy
delta.gee(a) bar delta.bar(a) gee DON(P): Deterministic Object Networks g b d {foo,bar} , {foo,gee} {bar,gee} , {foo} gee bar bar gee 3- Confluence and Determinacy
g {gee}, {f,g} Static DON a d f {foo,bar} , {gee} {gee}, {f,g} {foo,bar} , {gee} {f,g} g g g foo f {foo}, {bar} {foo,bar} , {gee} bar f e b {gee}, {f,g} {bar} , {gee} {gee}, {f,g} gee 3- Confluence and Determinacy
Contents • 1 - ASP Principles • 2 - Syntax and Semantics • 3 - Confluence and Determinacy • 4 - Conclusion
Conclusion • An Asynchronous Object Calculus : • Structured asynchronous activities • Structured communications with futures • Data-driven synchronization • ASP Confluence and Determinacy • Future updates can occur at any time • Execution characterized by the order of request senders • Determinacy of programs communicating over trees, … Thank You Any Question? 4- Conclusion
Perspectives • Approximation of confluence property • Static analysis • Generalization of confluence property • Functional behavior • Scheduling of requests • Extensions of ASP • Group communication • Component calculus • Mobility and other features
Related Work • Futures and Wait by Necessity: • MultiLisp by Halstead • Wait-By-Necessity by Caromel • Determinism: • pobl by Jones, Linearized channels • Process Networks by Kahn and MacQueen • Objects and concurrency: • Obliq, Gordon-Hankin-Lassen • Actors • -calculus, blue calculus, join-calculus
Intermediate Structures • Terms: • Configuration: • Request queue: • Futures list: • Store:
Static DON versus Process Networks a d f {foo,bar} , {gee} {gee}, {f},{g} {foo,bar} , {gee} {f},{g} g put g g foo f {foo,bar} , {gee} {foo}, {bar} bar f e b get {bar} , {gee} {gee}, {f},{g} {gee}, {f},{g} gee
g newact Activity Creation ( NEWACT ) a Active(a) b newact=Active(a)
Objects Topology a b g d
Equivalence Modulo Futures Updates a f1 b g f2 f3
More Futures a d ... result.bar() g b
More Futures a d result.bar() g b
More Futures a d result.bar() g b
More Futures a d result.bar() g b
More Futures a d Futures updates can occur at any time result.bar() g b
Constraint programming, different notion of store Shared memory No internal state in the store (functional agents) Data-driven / constraint driven synchronization: Blocking Ask Determinate case Concurrent Constraint Programming
g Activity Creation ( NEWACT ) a Active(a,s) newact=Active(a,s)
g newact ao.s() Activity Creation ( NEWACT ) a Active(a,s) newact=Active(a,s)
a f1 b g f2 Equivalence Modulo Futures Updates a f1 b g f2 f3
f1 f1 Equivalence Modulo Futures Updates a a f2 f1 b g b g f2 f3
b Store Partitioning
Request Service ( SERVE ) b Serve(foo) bar foo Serve(foo);...
foo Request Service ( SERVE ) b Serve(foo) foo ... bar Serve(foo);...
Objectives • Model of the following features • Object orientation (activities, communications) • Asynchronous communications with futures • Service policy • Confluence and determinacy • Identify sources of non-determinism • Characterize equivalent executions • Give general properties • Find some properties easy to verify
End Of Service ( ENDSERVICE ) b value foo ... bar
... End Of Service ( ENDSERVICE ) b value foo ... bar