1 Ivan Lanese Computer Science Department University of Bologna Italy Types for deadlock avoidance in SSCC.

Post on 31-Mar-2015

213 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

1

Ivan LaneseComputer Science Department

University of BolognaItaly

Types for deadlock avoidance in SSCC

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

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

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]

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

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

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

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

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

Cyclic dependencies

The most difficult problem

(ºa)stream(a ( (x)feedx)

asf = hi inf (z):a ) 5

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

And finally…

If the system satisfies all these conditions…

… then it is deadlock-free

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

End of talk

top related