Annotated Ada Reference ManualLegal Information
Contents   Index   References   Search   Previous   Next 

E.2.3 Remote Call Interface Library Units

1
[A remote call interface library unit can be used as an interface for remote procedure calls (RPCs) (or remote function calls) between active partitions.] 

Language Design Principles

1.a
The restrictions governing a remote call interface library unit are intended to ensure that the values of the actual parameters in a remote call can be meaningfully sent between two active partitions.

Syntax

2
{categorization pragma (Remote_Call_Interface) [partial]} {pragma, categorization (Remote_Call_Interface) [partial]} The form of a pragma Remote_Call_Interface is as follows: 
3
  pragma Remote_Call_Interface[(library_unit_name)];
4
The form of a pragma All_Calls_Remote is as follows: 
5
  pragma All_Calls_Remote[(library_unit_name)];
6
{library unit pragma (All_Calls_Remote) [partial]} {pragma, library unit (All_Calls_Remote) [partial]} A pragma All_Calls_Remote is a library unit pragma. 

Legality Rules

7/1
{8652/0078} {AI95-00048-01} {remote call interface} {RCI (library unit)} {RCI (package)} {RCI (generic)} {remote subprogram} A remote call interface (RCI) is a library unit to which the pragma Remote_Call_Interface applies. A subprogram declared in the visible part of such a library unit, or declared by such a library unit, is called a remote subprogram.
8
The declaration of an RCI library unit shall be preelaborable (see 10.2.1), and shall depend semantically only upon declared pure, shared passive, remote types, or other remote call interface library units.
9/1
{8652/0078} {AI95-00048-01} In addition, the following restrictions apply to an RCI library unit:
10/1
{8652/0078} {AI95-00048-01} its visible part shall not contain the declaration of a variable; 
10.a/1
Reason: {8652/0078} {AI95-00048-01} Remote call interface units do not provide remote data access. A shared passive package has to be used for that. 
11/1
{8652/0078} {AI95-00048-01} its visible part shall not contain the declaration of a limited type;
11.a/2
Reason: {AI95-00240-01} {AI95-00366-01} We disallow the declaration of task and protected types, since calling an entry or a protected subprogram implicitly passes an object of a limited type (the target task or protected object). We disallow other limited types since we require that such types have available Read and Write attributes, but we certainly don't want the Read and Write attributes themselves to involve remote calls (thereby defeating their purpose of marshalling the value for remote calls). 
12/1
{8652/0078} {AI95-00048-01} its visible part shall not contain a nested generic_declaration;
12.a
Reason: This is disallowed because the body of the nested generic would presumably have access to data inside the body of the RCI package, and if instantiated in a different partition, remote data access might result, which is not supported. 
13/1
{8652/0078} {AI95-00048-01} it shall not be, nor shall its visible part contain, the declaration of a subprogram to which a pragma Inline applies;
14/2
{8652/0078} {AI95-00048-01} {AI95-00240-01} {AI95-00366-01} it shall not be, nor shall its visible part contain, a subprogram (or access-to-subprogram) declaration whose profile has [an access parameter or] a parameter of a type that does not support external streaming (see 13.13.2);
15
any public child of the library unit shall be a remote call interface library unit. 
15.a
Reason: No restrictions apply to the private part of an RCI package, and since a public child can “see” the private part of its parent, such a child must itself have a Remote_Call_Interface pragma, and be assigned to the same partition (see below). 
15.b
Discussion: We considered making the public child of an RCI package implicitly RCI, but it seemed better to require an explicit pragma to avoid any confusion.
15.c
Note that there is no need for a private child to be an RCI package, since it can only be seen from the body of its parent or its siblings, all of which are required to be in the same active partition. 
16
If a pragma All_Calls_Remote applies to a library unit, the library unit shall be a remote call interface. 

Post-Compilation Rules

17
A remote call interface library unit shall be assigned to at most one partition of a given program. A remote call interface library unit whose parent is also an RCI library unit shall be assigned only to the same partition as its parent. 
17.a/1
Implementation Note: {8652/0078} {AI95-00048-01} The declaration of an RCI unit, with a calling-stub body, is automatically included in all active partitions with compilation units that depend on it. However the whole RCI library unit, including its (non-stub) body, will only be in one of the active partitions. 
18
{compilation units needed (remote call interface) [partial]} {needed (remote call interface) [partial]} {notwithstanding} Notwithstanding the rule given in 10.2, a compilation unit in a given partition that semantically depends on the declaration of an RCI library unit, needs (in the sense of 10.2) only the declaration of the RCI library unit, not the body, to be included in that same partition. [Therefore, the body of an RCI library unit is included only in the partition to which the RCI library unit is explicitly assigned.]

Implementation Requirements

19/1
{8652/0078} {AI95-00048-01} If a pragma All_Calls_Remote applies to a given RCI library unit, then the implementation shall route any call to a subprogram of the RCI unit from outside the declarative region of the unit through the Partition Communication Subsystem (PCS); see E.5. Calls to such subprograms from within the declarative region of the unit are defined to be local and shall not go through the PCS. 
19.a/1
Discussion: {8652/0078} {AI95-00048-01} Without this pragma, it is presumed that most implementations will make direct calls if the call originates in the same partition as that of the RCI unit. With this pragma, all calls from outside the subsystem rooted at the RCI unit are treated like calls from outside the partition, ensuring that the PCS is involved in all such calls (for debugging, redundancy, etc.). 
19.b
Reason: There is no point to force local calls (or calls from children) to go through the PCS, since on the target system, these calls are always local, and all the units are in the same active partition. 

Implementation Permissions

20
An implementation need not support the Remote_Call_Interface pragma nor the All_Calls_Remote pragma. [Explicit message-based communication between active partitions can be supported as an alternative to RPC.]
20.a
Ramification: Of course, it is pointless to support the All_Calls_Remote pragma if the Remote_Call_Interface pragma (or some approximate equivalent) is not supported. 

Incompatibilities With Ada 95

20.b/2
{AI95-00240-01} {incompatibilities with Ada 95} Amendment Correction: The wording was changed from “user-specified” to “available” attributes. (This was then further changed, see below.) This means that a type with the attributes specified in the private part would originally have been allowed as a formal parameter of an RCI subprogram, but that is no longer allowed. This change was made so that the rules were consistent with the rules introduced for the Corrigendum for stream attributes; moreover, legality should not depend on the contents of the private part. 

Wording Changes from Ada 95

20.c/2
{8652/0078} {AI95-00048-01} Corrigendum: Changed the wording to allow a library subprogram to be a remote call interface unit.
20.d/2
{AI95-00366-01} Changed the wording to use the newly defined term type that supports external streaming, so that various issues with access types in pure units and implicitly declared attributes for type extensions are properly handled. 

Contents   Index   References   Search   Previous   Next 
Ada-Europe Sponsored by Ada-Europe