Ada Reference ManualLegal Information
Contents   Index   References   Search   Previous   Next 

D.11 Asynchronous Task Control

1
This clause introduces a language-defined package to do asynchronous suspend/resume on tasks. It uses a conceptual held priority value to represent the task's held state. 

Static Semantics

2
The following language-defined library package exists: 
3/2
with Ada.Task_Identification;
package Ada.Asynchronous_Task_Control is
  pragma Preelaborate(Asynchronous_Task_Control);
  procedure Hold(T : in Ada.Task_Identification.Task_Id);
  procedure Continue(T : in Ada.Task_Identification.Task_Id);
  function Is_Held(T : Ada.Task_Identification.Task_Id)
   return Boolean;
end Ada.Asynchronous_Task_Control;

Dynamic Semantics

4/2
After the Hold operation has been applied to a task, the task becomes held. For each processor there is a conceptual idle task, which is always ready. The base priority of the idle task is below System.Any_Priority'First. The held priority is a constant of the type Integer whose value is below the base priority of the idle task. 
4.1/2
  For any priority below System.Any_Priority'First, the task dispatching policy is FIFO_Within_Priorities. 
5/2
The Hold operation sets the state of T to held. For a held task, the active priority is reevaluated as if the base priority of the task were the held priority. 
6/2
The Continue operation resets the state of T to not-held; its active priority is then reevaluated as determined by the task dispatching policy associated with its base priority.
7
The Is_Held function returns True if and only if T is in the held state. 
8
As part of these operations, a check is made that the task identified by T is not terminated. Tasking_Error is raised if the check fails. Program_Error is raised if the value of T is Null_Task_Id.

Erroneous Execution

9
If any operation in this package is called with a parameter T that specifies a task object that no longer exists, the execution of the program is erroneous. 

Implementation Permissions

10
An implementation need not support Asynchronous_Task_Control if it is infeasible to support it in the target environment. 
NOTES
11
37  It is a consequence of the priority rules that held tasks cannot be dispatched on any processor in a partition (unless they are inheriting priorities) since their priorities are defined to be below the priority of any idle task.
12
38  The effect of calling Get_Priority and Set_Priority on a Held task is the same as on any other task.
13
39  Calling Hold on a held task or Continue on a non-held task has no effect.
14
40  The rules affecting queuing are derived from the above rules, in addition to the normal priority rules: 
15
16
17
18/1
19

Contents   Index   References   Search   Previous   Next 
Ada-Europe Sponsored by Ada-Europe