D.2.2 Task Dispatching Pragmas
{
AI95-00355-01}
{
AI05-0299-1}
[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);
Name Resolution Rules
Legality Rules
This paragraph
was deleted.
Static Semantics
{
AI95-00355-01}
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.
Reason: {
AI95-00355-01}
Each ready queue is managed by exactly one policy. Anything else would
be chaos. The ready queue is determined by the active priority. However,
how the active priority is calculated is determined by the policy; in
order to break out of this circle, we have to say that the active priority
is calculated by the method determined by the policy of the base priority.
{
AI95-00355-01}
{
AI05-0262-1}
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
{
AI95-00355-01}
A Task_Dispatching_Policy pragma
is a configuration pragma. A Priority_Specific_Dispatching pragma is
a configuration pragma.
{
AI95-00355-01}
The priority ranges specified in more than one Priority_Specific_Dispatching
pragma within the same partition shall not be overlapping.
{
AI95-00355-01}
If a partition contains one or more Priority_Specific_Dispatching pragmas
it shall not contain a Task_Dispatching_Policy pragma.
Dynamic Semantics
{
AI95-00355-01}
[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.
{
AI95-00355-01}
If neither
pragma
applies to any of the program units comprising a partition, the task
dispatching policy for that partition is unspecified.
{
AI95-00355-01}
{
AI05-0262-1}
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.
Discussion: {
AI05-0005-1}
If we have priority specific dispatching then we want preemption across
the entire range of priorities. That prevents higher priority tasks from
being blocked by lower priority tasks that have a different policy. On
the other hand, if we have a single policy for the entire partition,
we want the characteristics of that policy to apply for preemption; specifically,
we might not require any preemption. Note that policy Non_Preemptive_FIFO_Within_Priorities
is not allowed in a priority specific dispatching pragma.
{
AI95-00355-01}
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.
Ramification: Once subject to the new
dispatching policy, it may be immediately preempted or dispatched, according
the rules of the new policy.
Paragraphs 7 through
13 were moved to D.2.3.
Implementation Requirements
{
AI95-00333-01}
{
AI95-00355-01}
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.
This paragraph
was deleted.
Implementation Permissions
{
AI95-00256-01}
{
AI12-0444-1}
Implementations are allowed to define other task dispatching policies,
but are not required to support specifying more than one task dispatching
policy per partition.
{
AI95-00355-01}
{
AI12-0444-1}
An implementation is not required to support
pragma
Priority_Specific_Dispatching if it is infeasible to support it in the
target environment.
Implementation defined: Implementation
defined task dispatching policies.
Paragraphs 19 through
21 were deleted.
Extensions to Ada 95
{
AI95-00333-01}
Amendment Correction: It is no longer required
to specify Ceiling_Locking with the language-defined task dispatching
policies; we only require that implementations
allow them to be
used together.
{
AI95-00355-01}
{
AI05-0005-1}
Pragma Priority_Specific_Dispatching is new; it allows the specification
of different policies for different priorities.
Wording Changes from Ada 95
{
AI95-00256-01}
Clarified that an implementation need support only one task dispatching
policy (of any kind, language-defined or otherwise) per partition.
{
AI95-00321-01}
{
AI05-0005-1}
This description is simplified to describe only the rules for the Task_Dispatching_Policy
pragma that are common to all policies. In particular, rules about preemption
are moved elsewhere. This makes it easier to add other policies (which
might not involve preemption).
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe