Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
 
Annotated Ada Reference Manual (Ada 202x Draft 25)Legal Information
Contents   Index   References   Search   Previous   Next 

H.6 Pragma Partition_Elaboration_Policy

1/3
{AI95-00265-01} {AI05-0299-1} This subclause defines a pragma for user control over elaboration policy. 

Syntax

2/2
{AI95-00265-01} The form of a pragma Partition_Elaboration_Policy is as follows: 
3/2
  pragma Partition_Elaboration_Policy (policy_identifier);
4/2
The policy_identifier shall be either Sequential, Concurrent or an implementation-defined identifier.
4.a/2
Implementation defined: Implementation-defined policy_identifiers allowed in a pragma Partition_Elaboration_Policy.
4.b/3
Ramification: Note that the Ravenscar profile (see D.13) has nothing to say about which Partition_Elaboration_Policy is used. This was intentionally omitted from the profile, as there was no agreement as to whether the Sequential policy should be required for Ravenscar programs. As such it was defined separately. 

Post-Compilation Rules

5/2
{AI95-00265-01} A pragma Partition_Elaboration_Policy is a configuration pragma. It specifies the elaboration policy for a partition. At most one elaboration policy shall be specified for a partition.
6/3
{AI95-00265-01} {AI05-0264-1} If the Sequential policy is specified for a partition, then pragma Restrictions (No_Task_Hierarchy) shall also be specified for the partition. 

Dynamic Semantics

7/2
{AI95-00265-01} Notwithstanding what this International Standard says elsewhere, this pragma allows partition elaboration rules concerning task activation and interrupt attachment to be changed. If the policy_identifier is Concurrent, or if there is no pragma Partition_Elaboration_Policy defined for the partition, then the rules defined elsewhere in this Standard apply.
8/2
{AI95-00265-01} {AI95-00421-01} If the partition elaboration policy is Sequential, then task activation and interrupt attachment are performed in the following sequence of steps:
9/2
The activation of all library-level tasks and the attachment of interrupt handlers are deferred until all library units are elaborated.
10/2
The interrupt handlers are attached by the environment task.
11/2
The environment task is suspended while the library-level tasks are activated.
12/2
The environment task executes the main subprogram (if any) concurrently with these executing tasks. 
13/2
{AI95-00265-01} {AI95-00421-01} If several dynamic interrupt handler attachments for the same interrupt are deferred, then the most recent call of Attach_Handler or Exchange_Handler determines which handler is attached.
14/2
{AI95-00265-01} {AI95-00421-01} If any deferred task activation fails, Tasking_Error is raised at the beginning of the sequence of statements of the body of the environment task prior to calling the main subprogram.

Implementation Advice

15/3
{AI95-00265-01} {AI05-0264-1} If the partition elaboration policy is Sequential and the Environment task becomes permanently blocked during elaboration, then the partition is deadlocked and it is recommended that the partition be immediately terminated. 
15.a/3
Implementation Advice: If the partition elaboration policy is Sequential and the Environment task becomes permanently blocked during elaboration, then the partition should be immediately terminated.

Implementation Permissions

16/3
{AI95-00265-01} {AI05-0264-1} If the partition elaboration policy is Sequential and any task activation fails, then an implementation may immediately terminate the active partition to mitigate the hazard posed by continuing to execute with a subset of the tasks being active. 
NOTES
17/2
12  {AI95-00421-01} If any deferred task activation fails, the environment task is unable to handle the Tasking_Error exception and completes immediately. By contrast, if the partition elaboration policy is Concurrent, then this exception could be handled within a library unit. 

Extensions to Ada 95

17.a/2
{AI95-00265-01} {AI95-00421-01} Pragma Partition_Elaboration_Policy is new. 

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe