Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
Annotated Ada Reference ManualLegal Information
Contents   Index   References   Search   Previous   Next 

D.16 Multiprocessor Implementation

{AI05-0171-1} {AI05-0299-1} This subclause allows implementations on multiprocessor platforms to be configured. 

Static Semantics

{AI05-0171-1} The following language-defined library package exists: 
package System.Multiprocessors is
   pragma Preelaborate(Multiprocessors);
   type CPU_Range is range 0 .. implementation-defined;
   Not_A_Specific_CPU : constant CPU_Range := 0;
   subtype CPU is CPU_Range range 1 .. CPU_Range'Last;
Implementation defined: The value of CPU_Range'Last in System.Multiprocessors.
   function Number_Of_CPUs return CPU;
end System.Multiprocessors;
{AI05-0171-1} A call of Number_Of_CPUs returns the number of processors available to the program. Within a given partition, each call on Number_Of_CPUs will return the same value.
{AI05-0229-1} For a task type (including the anonymous type of a single_task_declaration) or subprogram, the following language-defined representation aspect may be specified:
The aspect CPU is an expression, which shall be of type System.Multiprocessors.CPU_Range.
Aspect Description for CPU: Processor on which a given task should run.

Legality Rules

{AI05-0171-1} {AI05-0229-1} If the CPU aspect is specified for a subprogram, the expression shall be static.
 {AI05-0229-1} The CPU aspect shall not be specified on a task interface type.

Dynamic Semantics

 {AI05-0171-1} {AI05-0229-1} {AI12-0081-1} The expression specified for the CPU aspect of a task type is evaluated for each time an task object of the task type is created (see 9.1). The CPU value is then associated with the task object whose task declaration specifies the aspect.
 {AI05-0171-1} {AI05-0229-1} The CPU aspect has no effect if it is specified for a subprogram other than the main subprogram; the CPU value is not associated with any task.
 {AI05-0171-1} {AI05-0229-1} The CPU value is associated with the environment task if the CPU aspect is specified for the main subprogram. If the CPU aspect is not specified for the main subprogram it is implementation defined on which processor the environment task executes. 
Implementation defined: The processor on which the environment task executes in the absence of a value for the aspect CPU.
 {AI05-0171-1} {AI05-0264-1} The CPU value determines the processor on which the task will activate and execute; the task is said to be assigned to that processor. If the CPU value is Not_A_Specific_CPU, then the task is not assigned to a processor. A task without a CPU aspect specified will activate and execute on the same processor as its activating task if the activating task is assigned a processor. If the CPU value is not in the range of System.Multiprocessors.CPU_Range or is greater than Number_Of_CPUs the task is defined to have failed, and it becomes a completed task (see 9.2).

Extensions to Ada 2005

{AI05-0171-1} {AI05-0229-1} The package System.Multiprocessors and the CPU aspect are new. 

Wording Changes from Ada 2012

{AI12-0081-1} Corrigendum: Clarified when the CPU aspect expression is evaluated. 

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