Professional Documents
Culture Documents
ADA Distributed Systems Annex 2009 Filminas
ADA Distributed Systems Annex 2009 Filminas
Thomas Quinot
AdaCore
Brussels, 2009-02-07
1 Introduction
4 Distributed Ada
6 Conclusion
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Distribution models
Distributed programming
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Service definition
package Z e i t g e i s t i s
type News Item i s
Author , Message : U n b o u n d e d S t r i n g ;
end News Item ;
type N e w s I t e m s i s a r r a y ( P o s i t i v e range <>)
o f News Item ;
p r o c e d u r e P o s t ( I t e m : News Item ) ;
f u n c t i o n Whats Up r e t u r n N e w s I t e m s ;
end Z e i t g e i s t ;
Making it remote
p r o c e d u r e P o s t ( I t e m : News Item ) ;
f u n c t i o n Whats Up r e t u r n N e w s I t e m s ;
end Z e i t g e i s t ;
S e r v e r P : P a r t i t i o n := ( Z e i t g e i s t ) ;
−− RCI p a c k a g e Z e i t g e i s t i s on p a r t i t i o n S e r v e r P
C l i e n t P : P a r t i t i o n := ( ) ;
−− P a r t i t i o n C l i e n t P h a s no RCI p a c k a g e s
f o r C l i e n t P ’ T e r m i n a t i o n use L o c a l T e r m i n a t i o n ;
−− No g l o b a l t e r m i n a t i o n
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Components
You have a shared bulletin board — now what if you want direct messaging
between users?
package C h a t U s e r s i s
type U s e r i s a b s t r a c t tagged l i m i t e d p r i v a t e ;
type U s e r R e f i s a c c e s s a l l User ’ C l a s s ;
f u n c t i o n Name (Who : U s e r ) r e t u r n S t r i n g ;
p r o c e d u r e Say
( From : String ;
To Whom : U s e r ;
What : String );
end C h a t U s e r s ;
Communicating components
Getting in touch
Each partition creates objects, and makes RACW that point to these object.
Now how do you initially obtain these pointers to remote objects?
wi th C h a t U s e r s ; use C h a t U s e r s ;
package Z e i t g e i s t i s
pragma R e m o t e C a l l I n t e r f a c e ;
type News Item i s
Author : User Ref ;
Message : U n b o u n d e d S t r i n g ;
end News Item ;
type N e w s I t e m s i s a r r a y ( P o s i t i v e range <>)
o f News Item ;
p r o c e d u r e P o s t ( I t e m : News Item ) ;
f u n c t i o n Whats Up r e t u r n N e w s I t e m s ; end Z e i t g e i s t ;
RCIs allow initially passing around RACW values.
The GNAT Pro Company
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Pure
Base data types declarations (no named access types, no
indirection)
No internal state
Remote Types
Complex data types (possibly encapsulating hidden access
types), remote access types
Remote Call Interface
Remotely callable subprograms
Semantic dependency (with) constraints:
Pure ← Remote Types ← Remote Call Interface ← non-categorized
Remote subprograms
Formal parameters must “support external streaming”:
no access types
no limited types
... unless stream attributes are specified.
package S t r e a m a b l e L i s t s i s
type L i s t i s p r i v a t e ;
p r o c e d u r e My Read
( S : a c c e s s Ada . S t r e a m s . R o o t S t r e a m T y p e ’ C l a s s ;
V : out L i s t ) ;
p r o c e d u r e My Write
( S : a c c e s s Ada . S t r e a m s . R o o t S t r e a m T y p e ’ C l a s s ;
V : List );
f o r L i s t ’ Read use My Read ;
f o r L i s t ’ W r i t e use My Write ;
private
...
end S t r e a m a b l e L i s t s ; The GNAT Pro Company
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Code generator
Produces client and server stubs. Part of the compiler.
Partitioning tool
Assigns units to partitions and builds executables.
Partition communication subsystem (PCS)
Runtime library called by the generated code, providing the
communication services.
00000
11111 00000
11111
00000
11111 00000
11111
00000
11111
00000000000
11111111111 00000
11111
00000000000
11111111111
00000000000
11111111111 00000000000
11111111111
Protocol personalities
00000000000
11111111111 00000000000
11111111111
Remote middleware
Outline
1 Introduction
4 Distributed Ada
6 Conclusion
Questions?