D.2.2 Task Dispatching Pragmas
This subclause allows a single task dispatching policy
to be defined for all priorities, or the range of priorities to be split
into subranges that are assigned individual dispatching policies.
Syntax
The form of a
pragma
Task_Dispatching_Policy is as follows:
pragma Task_Dispatching_Policy(
policy_identifier);
The form of a
pragma
Priority_Specific_Dispatching is as follows:
Name Resolution Rules
Legality Rules
The
policy_identifier
used in a
pragma
Task_Dispatching_Policy shall be the name of a task dispatching policy.
The
policy_identifier
used in a
pragma
Priority_Specific_Dispatching shall be the name of a task dispatching
policy.
Both
first_priority_expression
and
last_priority_expression
shall be static expressions in the range of System.Any_Priority;
last_priority_expression
shall have a value greater than or equal to
first_priority_expression.
Static Semantics
Pragma
Task_Dispatching_Policy specifies the single task dispatching policy.
Pragma
Priority_Specific_Dispatching specifies the task dispatching policy for
the specified range of priorities. Tasks with base priorities within
the range of priorities specified in a Priority_Specific_Dispatching
pragma have their active priorities determined according to the specified
dispatching policy. Tasks with active priorities within the range of
priorities specified in a Priority_Specific_Dispatching pragma are dispatched
according to the specified dispatching policy.
If a partition contains one or more Priority_Specific_Dispatching
pragmas, the dispatching policy for priorities not covered by any Priority_Specific_Dispatching
pragmas is FIFO_Within_Priorities.
Post-Compilation Rules
A Task_Dispatching_Policy
pragma is a configuration pragma. A Priority_Specific_Dispatching pragma
is a configuration pragma.
The priority ranges specified in more than one Priority_Specific_Dispatching
pragma within the same partition shall not be overlapping.
If a partition contains one or more Priority_Specific_Dispatching
pragmas it shall not contain a Task_Dispatching_Policy pragma.
This paragraph was
deleted.
Dynamic Semantics
A
task dispatching policy
specifies the details of task dispatching that are not covered by the
basic task dispatching model. These rules govern when tasks are inserted
into and deleted from the ready queues. A single task dispatching policy
is specified by a Task_Dispatching_Policy pragma. Pragma Priority_Specific_Dispatching
assigns distinct dispatching policies to subranges of System.Any_Priority.
If neither
pragma
applies to any of the program units comprising a partition, the task
dispatching policy for that partition is unspecified.
If a partition contains one or more Priority_Specific_Dispatching
pragmas, a task dispatching point occurs for the currently running task
of a processor whenever there is a nonempty ready queue for that processor
with a higher priority than the priority of the running task.
A task that has its base priority changed may move
from one dispatching policy to another. It is immediately subject to
the new dispatching policy.
Paragraphs 7 through
13 were moved to D.2.3.
Implementation Requirements
An implementation shall allow, for a single partition,
both the locking policy (see
D.3) to be specified
as Ceiling_Locking and also one or more Priority_Specific_Dispatching
pragmas to be given.
Documentation Requirements
Paragraphs 14 through
16 were moved to D.2.3.
Implementation Permissions
Implementations are allowed to define other task
dispatching policies, but need not support more than one task dispatching
policy per partition.
An implementation need not support
pragma
Priority_Specific_Dispatching if it is infeasible to support it in the
target environment.
Paragraphs 19 through
21 were deleted.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe