Version 1.1 of ais/ai-00210.txt

Unformatted version of ais/ai-00210.txt version 1.1
Other versions for file ais/ai-00210.txt

!standard H.4 (24)          98-10-01 AI95-00210/00
!standard H.4 (27)
!class ramification 98-10-01
!status received 98-10-01
!priority Medium
!difficulty Medium
!subject Questions on pragma Restriction No_Recursion and No_Reentrancy
!summary 98-10-01
!question 98-10-01
Neither pragma Restriction(No_Recursion) nor pragma Restriction(No_Reentrancy) can (in general at least) be checked statically. Must we make run-time tests in order to conform with Annex H?
Does pragma Restriction(No_Recursion) and pragma Restriction(No_Reentrancy) apply to the runtime system? Making a RTS that is free of Recursion is of course possible. However, a RTS that is not reentrant does not make much sense. For instance, on task can be suspended in an accept statement while another task calls an accept statement.
!response 98-10-01
!appendix

!topic     Must pragma Restriction(No_Recursion) and pragma
<<reference as: 1998-15856.a Sven H. Sorensen 1998-4-24>>
           Restriction(No_Reentrancy) be checked for at compile-time,
           link-time or run-time?
!reference RM95-13.12(8), RM95-H.4(27)
!from      Sven Soerensen, DDC-I A/S, Denmark, shs@ddci.dk
!discussion

Neither pragma Restriction(No_Recursion) nor pragma
Restriction(No_Reentrancy) can (in general at least) be checked statically.
Must we make run-time tests in order to conform with Annex H?

RM 13.12(8):
     A pragma Restrictions is a configuration pragma;
     unless otherwise specified for a particular restriction, a partition
     ^^^^^^^^^^^^^^^^^^^^^^^^^^
     shall obey the restriction if a pragma Restrictions applies to any
     compilation unit included in the partition.

RM H.4(27):
     Program execution is erroneous if pragma Restrictions(No_Recursion)
     has been specified and a subprogram is invoked as part of its own
     execution, or if pragma Restrictions(No_Reentrancy) has been specified
     and during the execution of a subprogram by a task, another task
     invokes the same subprogram.

Is RM H.4(27) allowing us not to check the two restrictions, i.e., let it
be up to the user to write code that conform with the restrictions?

It seems to me that the two paragraphs are in direct contradiction with each
other.

-------

!topic     Does pragma Restriction(No_Recursion) and pragma
<<reference as: 1998-15856.b Sven H. Sorensen 1998-4-24>>
           Restriction(No_Reentrancy) apply to the RTS as well?
!reference RM95-H.4(24)
!from      Sven Soerensen, DDC-I A/S, Denmark, shs@ddci.dk
!discussion


AARM H.4(24):
     If an implementation supports pragma Restrictions for a particular
     argument, then except for the restrictions No_Unchecked_Deallocation,
     No_Unchecked_Conversion, No_Access_Subprograms, and
     No_Unchecked_Access, the associated restriction applies to the
     run-time system.

Making a RTS that is free of Recursion is of course possible. However,
a RTS that is not reentrant does not make much sense.  For instance, on
task can be suspended in an accept statement while another task calls an
accept statement.

Regards,

Sven
-- 
  Sven Henrik Soerensen             Email:   shs@ddci.dk
  DDC-I A/S                         Phone:   +45 45 87 20 77 ext. 320
  Gl. Lundtoftevej 1 B            Telefax:   +45 45 87 22 17
  DK-2800 Lyngby,  Denmark      Secretary:   +45 45 87 11 44

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



Questions? Ask the ACAA Technical Agent