Page 1
ASYNCHRONOUS AND DETERMINISTIC OBJECTS
ASP: Asynchronous Sequential Processes Distributed objects Asynchronous method calls Futures and Wait-by-necessity Determinism properties
Denis CAROMEL, Ludovic HENRIO, Bernard Paul SERPETTE
I3S - INRIA - Univ Nice Sophia-Antipolis
Page 2
Context
-calculus Objects, not concurrent Some concurrent extensions, not our way to determinism
-calculus Communications, channel based, not object structured Linear(ized) channels(o), no implicit synchronization
Process Networks Processes, channel based, not object oriented Determinism, no implicit synchronization
Context
Page 3
Contents
1 - ASP Principles
2 - Syntax and Semantics
3 - Confluence and Determinacy
4 - Conclusion
Page 4
f3
f1
Structure
1- ASP Principles
foo
foo
f2
Active(a)
Page 5
foo
beta.foo(b)
result=beta.foo(b)
Sending Requests ( REQUEST )
1- ASP Principles
Page 6
foo
beta.foo(b)result
Sending Requests ( REQUEST )
1- ASP Principles
result=beta.foo(b)
Page 7
foo
beta.foo(b)
Serve(foo);...
result
Serving Requests ( SERVE )
Serve(foo);...
bar
1- ASP Principles
Page 8
beta.foo(b)result
Serving Requests ( SERVE )
Serve(foo)
barfoo ...foo
1- ASP Principles
Serve(foo);...
Page 9
...foo
End of Service ( ENDSERVICE )
value
1- ASP Principles
Page 10
foo
End of Service ( ENDSERVICE )
...
1- ASP Principles
Page 11
foo
Sending Results ( REPLY )
1- ASP Principles
Page 12
Sending Results ( REPLY )
foo
1- ASP Principles
Page 13
delta.send(result)
Wait by Necessity
1- ASP Principles
Page 14
delta.send(result)result.bar()result.bar()
Wait by Necessity
1- ASP Principles
Page 15
delta.send(result)result.bar()result.bar()
Wait by Necessity
1- ASP Principles
Page 16
Wait by Necessity
result.bar()Futures updates can occur at any time
Futures updates can occur at any time
1- ASP Principles
Page 17
1 - ASP Principles
2 - Syntax and Semantics
3 - Confluence and Determinacy
4 - Conclusion
Contents
Page 18
ASP Syntax : source terms
2- Syntax and Semantics
Imperative-calculus
ASP parallelism primitives
Page 19
2- Syntax and Semantics
Local
CreatingActivity
Sendingrequest
Receivingreplies
Service
Page 20
Contents
1 - ASP Principles
2 - Syntax and Semantics
3 - Confluence and Determinacy
4 - Conclusion
Page 21
Compatibility
delta.foo()
foo
….Serve(foo,bar)
…Serve(foo,gee)
bar
gee
3- Confluence and Determinacy
Serves the oldest request on foo OR bar
Page 22
Confluence
Potential services:
3- Confluence and Determinacy
P0
P Q
R
RSL definition:
Compatibility Confluence
Configuration Compatibility:Execution characterized
by the order of Request SendersExecution characterized
by the order of Request Senders
Page 23
Deterministic Object Networks
{foo,bar} , {foo,gee}
delta.gee(a)
gee
delta.bar(a)bar
{bar,gee} , {foo}
gee barbar gee
3- Confluence and Determinacy
DON(P):
Page 24
Static DON
{foo,bar} , {gee}
{foo,bar} , {gee}
{gee}, {f,g}
{bar} , {gee}
{foo,bar} , {gee}
foo
bar
f{foo}, {bar}
{gee}, {f,g}
{f,g}{gee}, {f,g}f
g
gee
f
g
{gee}, {f,g}
3- Confluence and Determinacy
g
Page 25
Contents
1 - ASP Principles
2 - Syntax and Semantics
3 - Confluence and Determinacy
4 - Conclusion
Page 26
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, …
4- Conclusion
Thank You
Any Question?
Thank You
Any Question?
Page 27
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
Page 28
Related Work
Futures and Wait by Necessity: MultiLisp by Halstead Wait-By-Necessity by Caromel
Determinism: by JonesLinearized channels Process Networks by Kahn and MacQueen
Objects and concurrency: Obliq, Gordon-Hankin-Lassen Actors -calculus, blue calculus, join-calculus
Page 29
Terms:
Configuration: Request queue: Futures list: Store:
Intermediate Structures
Page 30
Static DON versus Process Networks
{foo,bar} , {gee}
{foo,bar} , {gee}
{gee}, {f},{g}
{bar} , {gee}
{foo,bar} , {gee}
foo
bar
f{foo}, {bar}
{gee}, {f},{g}
{f},{g}{gee}, {f},{g}f
g
gee
f
g
put
get
Page 31
Active(a)
newact=Active(a)
newact
Activity Creation ( NEWACT )
Page 33
Equivalence Modulo Futures Updates
f1
f2
f3
Page 34
More Futures
...result.bar()
Page 35
More Futures
result.bar()
Page 36
More Futures
result.bar()
Page 37
More Futures
result.bar()
Page 38
More Futures
result.bar()Futures updates can occur at any time
Futures updates can occur at any time
Page 39
Concurrent Constraint Programming
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
Page 40
Active(a,s)
newact=Active(a,s)
Activity Creation ( NEWACT )
Page 41
Active(a,s)
newact=Active(a,s)
newact
Activity Creation ( NEWACT )
ao.s()
Page 42
Equivalence Modulo Futures Updates
f1
f2
f3
f1
f2
Page 43
Equivalence Modulo Futures Updates
f2
f3
f1
f1
f2
f1
Page 44
Store Partitioning
Page 45
Serve(foo)
Serve(foo);...
bar foo
Request Service ( SERVE )
Page 46
Serve(foo)
barfoo
Serve(foo);...
...foo
Request Service ( SERVE )
Page 47
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
Page 48
value
foo bar
...
End Of Service ( ENDSERVICE )
Page 49
value
barfoo
...
...
End Of Service ( ENDSERVICE )