on the formalization and comparison of coordination models and languages
DESCRIPTION
On the Formalization and Comparison of Coordination Models and Languages. Gianluigi Zavattaro. Department of Computer Science University of Bologna. Plan of the Talk. Coordination Infrastructures Data- vs Event-driven coord. (informally) Shared Dataspaces (formally) - PowerPoint PPT PresentationTRANSCRIPT
On the Formalization and Comparison of Coordination Models and Languages
Gianluigi Zavattaro Department of Computer Science
University of Bologna
Validation02 - Genova - 22/11/2002
2
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
3
Coordination Infrastructures: a Classification
A Data-driven Coordination Infrastructure TSpaces
An Event-driven Coordination Infrastructure Talarian SmartSockets
Validation02 - Genova - 22/11/2002
4
Common Features No direct Communication
Communication mediated by the infrastructure
Space Uncoupled Communication No channel topology
Time Uncoupled Communication Asynchronous communication
Associative Communication Communication based on content or subject
Validation02 - Genova - 22/11/2002
5
Motivation How much critical is the choice of the
kind of infrastructure in the design of a coordinated system?
Are event- and data-driven infrastructures interchangeable? Can each event-driven system be
reduced to an equivalent data-driven system without altering the internal behavior of the processes, and vice versa?
Validation02 - Genova - 22/11/2002
6
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
7
The Units of Coordination Event-driven coordination
Processes raise events An event is delivered to the processes
which subscribed their interest to its specific type
Data-driven coordination Processes produce data A datum may be accessed (read or
consumed) from all process in the system
Validation02 - Genova - 22/11/2002
8
Creation An event can be raised whatever is
the current state of the system A datum can be produced
whatever is the current content of the shared repository
The production of the Units of Coordination is Non-Blocking
Validation02 - Genova - 22/11/2002
9
Lifetime An event plays a role in the system
until its multicast finishes Implicitly received/removed from the
system A datum remains in the shared
repository until it is explicitly withdrawn Explicitly read/consumed
Validation02 - Genova - 22/11/2002
10
Visibility An event is visible only and
exactly to the subscribed processes Restricted visibility
A datum can be read/consumed by each process in the system Global visibility
Validation02 - Genova - 22/11/2002
11
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
12
A Shared DataspaceProcess Calculus (DS)C ::= 0 | <a> | P | C|CP ::= out(a).P | in(a).P | rd(a).P
| eval(P).P | K
With a taken from Namesand constant definition K=P
Validation02 - Genova - 22/11/2002
13
DS semanticsGraphically
rd(b).Qout(c).P
in(a).R
<b><a> <b
>eval(T).S
<c>
T
Validation02 - Genova - 22/11/2002
14
DS semanticsReduction relation (some rules)
out(a).P <a> | P in(a).P | <a> P rd(a).P | <a> P | <a> eval(P).Q P | QAssuming commutativity and
associativity of parallel comp.
Validation02 - Genova - 22/11/2002
15
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
16
A Publish/Subscribe Process Calculus (PS)C ::= 0 | on(e,P) | P | C|CP ::= pub(e).P | sub(e,P).P |
unsub(e,P).P | new(P).P | K
With e taken from Eventsand constant definition K=P
Validation02 - Genova - 22/11/2002
17
PS semanticsGraphically
sub(e,P).Q
new(U).V
unsub(f,S).T
pub(e).R
on(e,P)on(e,Z)
on(f,S)
P
ZU
Validation02 - Genova - 22/11/2002
18
PS semanticsLabeled Transition Syst. (some rules)
sub(e,P).Q on(e,P) | Q unsub(e,P).Q | on(e,P) Q on(e,P) e on(e,P) | P pub(e).P e P P e P’ Q e Q’
P | Q e P’ | Q’
Validation02 - Genova - 22/11/2002
19
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
20
Reducing DS into PS Mapping entities of Dataspaces
into entities in Pub/Sub Data = listeners Output = listener production Input = listener consumption Read = Input+Output
Validation02 - Genova - 22/11/2002
21
The Reduction Function[[ 0 ]] = 0[[ K ]] = K (with K = [[ P ]])[[ out(a).P ]] = sub(ea,0).[[ P ]][[ in(a).P ]] = unsub(ea,0).[[ P ]][[ rd(a).P ]] = unsub(ea,0).sub(ea,0).[[ P
]][[ eval(P).Q ]] = new([[ P ]]).[[ Q ]]
Validation02 - Genova - 22/11/2002
22
Plan of the Talk Coordination Infrastructures Data- vs Event-driven coord.
(informally) Shared Dataspaces (formally) Publish/Subscribe (formally) Dataspace Pub/Sub Pub/Sub Dataspace + Global Op.
Validation02 - Genova - 22/11/2002
23
No Reduction of DS into PS A satisfactory reduction should preserve
at least termination [[ C ]] may terminate iff C may terminate
The existence of a terminating computation is Decidable in DS (reduction of DS to finite P/T
nets) Undecidable in PS (reduction of RAMs into
PS)Impossibility of any satisfactory
reduction
Validation02 - Genova - 22/11/2002
24
Reducing PS into finite P/T nets
<a>
Q
Pin(a).Q
out(a).P
Validation02 - Genova - 22/11/2002
25
Random Access Machine (RAM)
Registers: r1 … rn hold natural numbersProgram: sequence of numbered
instructions Inc(rj): add 1 to the content of rj and go to
the next instruction DecJump(rj,s): if the content of rj is not 0
then decrease by 1 and go to the next instruction; otherwise jump to instruction s
Validation02 - Genova - 22/11/2002
26
Encoding RAM in PS(the idea)
DecJump(rj,s): Non-det. choice between
Decrement = loop until decrement succeeds
Jump = publish rj and jump to instruction s
on(in,[[insn]])
on(i1,[[ins1]])…
Instructionson(r1,pub(r1))…on(r1,pub(r1))
on(rm,pub(rm))…on(rm,pub(rm))
Registers
Validation02 - Genova - 22/11/2002
27
Properties of the RAM encoding
Only termination is preserved: RAM iff [[ RAM ]] Oss: By C we mean the existence of a completed finite computation
Can we define also a divergence preserving encoding?Answer: no because the existence of an infinite computation is decidable
Validation02 - Genova - 22/11/2002
28
Decidability of Divergence We express PS in terms of P/T nets
with transfer arcs (divergence is decidable [DFS98])
R
P
pub(e).Ron(e,P)
start(P,a)
sub(e,P).Q
Q
Validation02 - Genova - 22/11/2002
29
Adding Global Operation We extend DS with a global
operation (inspired by copy-collect)
ccollect(a,P).Q
<a> <b>
<a><c>
P
P
Validation02 - Genova - 22/11/2002
30
Reducing PS into DS Listeners = data
on(e,P) = lsteP
Subscribe = data production [[ sub(e,P) ]] = out(lsteP)
Unsubscribe = data consumption [[ unsub(e,P) ]] = in(lsteP)
Publish = count each kind of listeners [[ pub(e) ]] = ccollect(lsteP1,P1)…
ccollect(lstePn,Pn)
Validation02 - Genova - 22/11/2002
31
Conclusion
DS calculus
PS calculus
TerminationUndecidable
TerminationDecidable
+ Glob. Operators
DivergenceDecidable