Version 1.2 of ai12s/ai12-0031-1.txt

Unformatted version of ai12s/ai12-0031-1.txt version 1.2
Other versions for file ai12s/ai12-0031-1.txt

!standard E.2.3(19/3)          12-06-06 AI12-0031-1/01
!class ramification 12-06-06
!status work item 12-06-06
!status received 12-05-17
!priority Low
!difficulty Medium
!subject All_Calls_Remote and indirect calls
!summary
**TBD.
!question
Does E.2.3(19/3) apply to indirect calls (that is those through access-to-subprogram values)? (???***???)
There are unnecessary complications if the clause applies to calls through access-to-subprogram objects. For example, if the program calls through a remote-access-to-subprogram object, the access object will probably contain a partition_ID, and it makes sense for the caller to check to see if the partition_ID refers to the current partition and make a local call if so. But if the rules require that it be a PCS call if the subprogram is in an All_Calls_Remote package, the code would have to somehow determine whether the subprogram address were in such a package.
Similarly, in the case of a normal access-to-subprogram object: the access object is probably just the address of a subroutine, and it would be the same subroutine that would be called for a direct call, which, for a remote subprogram in an All_Calls_Remote package, would be the address of a subroutine that uses the PCS to call the target routine. If such an access-to-subprogram object were then passed to a routine in a child package of the RCI unit, and the second sentence of E.2.3(19) applied to indirect calls, the child package code would have to somehow check the address in the access-to-subprogram object to see if it refers to a remote subprogram in the parent unit, so that it could make a local call instead of going through the PCS.
!response
** TBD.
!wording
** TBD.
!discussion
Note that ignoring the rule for "indirect" calls would seem to have the effect of eliminating the value of the "All_Calls_Remote" setting, because it would actually be "Most_Calls_Remote" :-).
OTOH, the implementation issues mentioned are real. So we probably have no choice but to exclude indirect calls from these rules.
Personally, I think this eliminates any value to this setting, and I'd probably suggest just dropping All_Calls_Remote completely from the standard. (Obviously, implementations could continue to support it with whatever meaning that they want.) I just cannot see what value "Most_Calls_Remote" could possibly have.
This AI is initially classified as a Ramification as we were hoping that we could restrict any changes to a TBH note. But I'm now thinking that was too optimistic.
!ACATS test
** TBD.
!appendix

From: Adam Beneschan
Sent: Thursday, May 17, 2012  3:12 PM

!topic Clarification on E.2.3(19)
!reference E.2.3(19)
!from Adam Beneschan 12-05-17
!discussion

Regarding this implementation requirement:

    If aspect All_Calls_Remote is True for 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.

are the "calls" mentioned here intended to refer only to direct calls, or also
to indirect ones?  It seems like there are unnecessary complications if the
clause is supposed to apply to calls through access-to-subprogram objects.  For
example, if the program calls through a remote-access-to-subprogram object, the
access object will probably contain a partition_ID, and it makes sense for the
caller to check to see if the partition_ID refers to the current partition and
make a local call if so.  But if the rules require that it be a PCS call if the
subprogram is in an All_Calls_Remote package, the code would have to somehow
determine whether the subprogram address were in such a package.

Or in the case of a normal access-to-subprogram object: the access object is
probably just the address of a subroutine, and it would be the same subroutine
that would be called for a direct call, which, for a remote subprogram in an
All_Calls_Remote package, would be the address of a subroutine that uses the PCS
to call the target routine. If such an access-to-subprogram object were then
passed to a routine in a child package of the RCI unit, and the second sentence
of E.2.3(19) applied to indirect calls, the child package code would have to
somehow check the address in the access-to-subprogram object to see if it refers
to a remote subprogram in the parent unit, so that it could make a local call
instead of going through the PCS.

****************************************************************

Questions? Ask the ACAA Technical Agent