1 ivan lanese computer science department university of bologna italy types for deadlock avoidance...
TRANSCRIPT
![Page 1: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/1.jpg)
1
Ivan LaneseComputer Science Department
University of BolognaItaly
Types for deadlock avoidance in SSCC
![Page 2: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/2.jpg)
What is SSCC?
SCC (Service Centered Calculus) is a Sensoria calculus for modelling web services and their interactions [see Rosario’s talk]
SSCC (Stream-based SCC) is a variation of SCC– For improving usability
– Has a stream construct for coordination among different services
– Developed with en eye on typability
![Page 3: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/3.jpg)
SSCC syntax
streamP asf inQfeedv:Pf (x):P
9=
;Coordination
P ::= P jQ(ºa)P0recX :PX
9>>>>=
>>>>;
Standard operators
a ) Pa ( P
¾
Services
v:P(x)P
¾Conversations
![Page 4: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/4.jpg)
An idea about the semantics
Service definitions and invocations interact creating sessions
Values can be exchanged between corresponding sessions
Streams can be used to make different systems interact
(ºr)(r B v:P jr C (x)Q) ! (ºr)(r B P jr C Q[v=x])
a ) P ja ( Q ! (ºr)(r B P jr C Q)
streamfeedv:P asf = hi inf (x):QstreamP asf = hvi inf (x):QstreamP asf = hi inQ[v=x]
![Page 5: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/5.jpg)
Fast example
Invoke services a and b and use the results to invoke c
stream(a ( (x)feedx)j(b( (y)feedy)
asf = hi inf (z):f (w):c ( z:w:(t)feedt
![Page 6: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/6.jpg)
Deadlock avoidance in SSCC
Many possible causes of deadlock in the system– Invoked service not available
– Client and server protocols not compatible
– Read stream empty
– Cyclic dependencies between the above things
![Page 7: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/7.jpg)
Invoked service not available
Difficult to avoid in general– Services can be created and removed dynamically
– Service names can be communicated
There are some simple to treat cases– Only persistent services at top level (always available)
– Linear services (just one definition and one invocation)» Types for linearity in π-calculus can be adapted
![Page 8: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/8.jpg)
Client and server protocols not compatible
Can be solved using session types Useful (and meaningful) to force sequentiality in
protocols Protocols
– ?T.U Input
– !T.U Output
– end End of protocol
Client and server protocols should be complementary
![Page 9: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/9.jpg)
Read stream empty
Streams are static Easy to ensure that the number of feeds to a stream is
greater than the number of reads from the stream Attach to the stream a type that includes the number of
values it will contain
![Page 10: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/10.jpg)
Cyclic dependencies
The most difficult problem
(ºa)stream(a ( (x)feedx)
asf = hi inf (z):a ) 5
![Page 11: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/11.jpg)
How to solve it?
Operators in the program should be stratified according to some priority– An operator can depend only on operators with higher priority
– Corresponding operators (e.g., definition and invocation of a service) should have the same priority
Priorities should be added to:– Services
– Streams
– Steps in service protocols
Operators with maximal priority are enabled
![Page 12: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/12.jpg)
And finally…
If the system satisfies all these conditions…
… then it is deadlock-free
![Page 13: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/13.jpg)
What we have done?
Written a type system ensuring– Protocol compatibility
– Stream values available
– No cyclic dependencies
If services are available then the system is deadlock-free Now writing and checking the proofs
![Page 14: 1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC](https://reader035.vdocuments.site/reader035/viewer/2022062620/551a77c9550346b52d8b5251/html5/thumbnails/14.jpg)
End of talk