CVS difference for ais/ai-00357.txt

Differences between 1.19 and version 1.20
Log of other versions for file ais/ai-00357.txt

--- ais/ai-00357.txt	2005/11/16 06:51:13	1.19
+++ ais/ai-00357.txt	2005/12/15 02:44:13	1.20
@@ -1,5 +1,8 @@
-!standard D.02.6 (01)                                 05-11-15  AI95-00357/12
+!standard D.02.6 (01)                                 05-12-02  AI95-00357/13
 !standard D.01 (20)
+!standard D.11 (04)
+!standard D.11 (05)
+!standard D.11 (06)
 !class amendment 03-09-27
 !status Amendment 200Y 04-12-02
 !status ARG Approved 10-0-0  04-11-20
@@ -116,12 +119,10 @@
 D.2.6 Earliest Deadline First Dispatching
 
 The deadline of a task is an indication of the urgency of the task; it
-represents a point on an ideal physical time line. For policies that use
-deadlines, whenever tasks compete for processors or other
-implementation-defined resources, the resources are allocated to the task with
-the earliest deadline.
+represents a point on an ideal physical time line. The deadline might affect
+how resources are allocated to the task.
 
-This clause defines a package for representing a task's deadline
+This clause defines a package for representing the deadline of a task
 and a dispatching policy that defines Earliest Deadline First (EDF)
 dispatching. A pragma is defined to assign an initial deadline to a task.
 
@@ -165,7 +166,7 @@
   procedure Delay_Until_And_Set_Deadline (
               Delay_Until_Time : in Ada.Real_Time.Time;
               Deadline_Offset : in Ada.Real_Time.Time_Span);
-  function Get_Deadline (T : in Ada.Task_Identification.Task_Id :=
+  function Get_Deadline (T : Ada.Task_Identification.Task_Id :=
               Ada.Task_Identification.Current_Task) return Deadline;
 end Ada.Dispatching.EDF;
 
@@ -206,7 +207,7 @@
 Delay_Until_Time. When the task becomes runnable again it will have deadline
 Delay_Until_Time + Deadline_Offset.
 
-On a system with a single processor, the setting of a task's deadline
+On a system with a single processor, the setting of the deadline of a task
 to the new value occurs immediately at the first point that is outside the
 execution of a protected action. If the task is currently on a ready
 queue it is removed and re-entered on to the ready queue determined by the
@@ -217,9 +218,9 @@
 The task at the head of a queue is the one with the earliest deadline.
 
 A task dispatching point occurs for the currently running task T to
-which policy EDF_Across_Priorities applies whenever:
+which policy EDF_Across_Priorities applies:
 
-  o a change to the deadline of T occurs;
+  o when a change to the deadline of T occurs;
 
   o there is a task on the ready queue for the active priority of T with
     a deadline earlier than the deadline of T; or
@@ -230,7 +231,8 @@
 In these cases, the currently running task is said to be preempted and is
 returned to the ready queue for its active priority.
 
-For a task T to which policy EDF_Across_Priorities applies, the active priority
+For a task T to which policy EDF_Across_Priorities applies, the base
+priority is not a source of priority inheritance; the active priority
 when first activated or while it is blocked is defined as the maximum of the
 following:
 
@@ -263,7 +265,7 @@
 as EDF_Across_Priorities, the task is added to the ready queue
 corresponding to its new active priority, as determined above.
 
-For all the operations defined in Ada.Dispatching.EDF, Tasking_Error
+For all the operations defined in Dispatching.EDF, Tasking_Error
 is raised if the task identified by T has terminated. Program_Error
 is raised if the value of T is Null_Task_Id.
 
@@ -284,8 +286,8 @@
 Documentation Requirements
 
 On a multiprocessor, the implementation shall document any conditions that
-cause the completion of the setting of a task's deadline to be delayed later
-than what is specified for a single processor.
+cause the completion of the setting of the deadline of a task to be delayed
+later than what is specified for a single processor.
 
 Notes
 
@@ -307,10 +309,35 @@
 Replace D.1(20) by:
 
 At any time, the active priority of a task is the maximum of all the priorities
-the task is inheriting at that instant. Sources of
+the task is inheriting at that instant. For a task that is not held (see D.11),
+its base priority is a source of priority inheritance unless otherwise
+specified for a particular task dispatching policy. Other sources of
 priority inheritance are specified under the following conditions:
 
+Add after D.11(4):
+
+For any priority below System.Any_Priority'First, the task dispatching policy
+is FIFO_Within_Priorities.
+
+AARM to be honest: This applies even if a Task_Dispatching_Policy specifies the
+policy for all of the priorities of the partition.
+
+AARM ramification: A task at the held priority never runs, so it is not
+necessary to implement FIFO_Within_Priorities for systems that have only one
+policy (such as EDF_Across_Priorities).
+
+Replace D.11(5) by:
+
+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.
 
+Replace D.11(6) by:
+
+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.
+
 !discussion
 
 The addition of procedure Delay_and_Set_Relative_Deadline reflects
@@ -364,6 +391,15 @@
 at the front of its ready queue even if its deadline is later than
 the next task on the queue.
 
+--
+
+We have to fix the rules for held and idle tasks, because the base priority
+does not participate in the determination of the active priority for EDF.
+The solution is to define that idle and held tasks always uses FIFO dispatching,
+even in an all-EDF system. This doesn't cause any implementation overhead,
+as such tasks never actually run, and thus no extra support is needed in the
+runtime.
+
 !corrigendum D.1(20)
 
 @drepl
@@ -373,19 +409,20 @@
 priority inheritance are specified under the following conditions:
 @dby
 At any time, the active priority of a task is the maximum of all the priorities
-the task is inheriting at that instant. Sources of
+the task is inheriting at that instant.
+For a task that is not held (see D.11), its base priority is a source of
+priority inheritance unless otherwise specified for a particular task
+dispatching policy. Other sources of
 priority inheritance are specified under the following conditions:
 
 !corrigendum D.2.6(1)
 
 @dinsc
 The deadline of a task is an indication of the urgency of the task; it
-represents a point on an ideal physical time line. For policies that use
-deadlines, whenever tasks compete for processors or other
-implementation-defined resources, the resources are allocated to the task with
-the earliest deadline.
+represents a point on an ideal physical time line. The deadline might affect
+how resources are allocated to the task.
 
-This clause defines a package for representing a task's deadline
+This clause defines a package for representing the deadline of a task
 and a dispatching policy that defines Earliest Deadline First (EDF)
 dispatching. A pragma is defined to assign an initial deadline to a task.
 
@@ -424,7 +461,7 @@
   @b<procedure> Delay_Until_And_Set_Deadline (
               Delay_Until_Time : @b<in> Ada.Real_Time.Time;
               Deadline_Offset : @b<in> Ada.Real_Time.Time_Span);
-  @b<function> Get_Deadline (T : @b<in> Ada.Task_Identification.Task_Id :=
+  @b<function> Get_Deadline (T : Ada.Task_Identification.Task_Id :=
               Ada.Task_Identification.Current_Task) @b<return> Deadline;
 @b<end> Ada.Dispatching.EDF;>
 
@@ -459,7 +496,7 @@
 Delay_Until_Time. When the task becomes runnable again it will have deadline
 Delay_Until_Time + Deadline_Offset.
 
-On a system with a single processor, the setting of a task's deadline
+On a system with a single processor, the setting of the deadline of a task
 to the new value occurs immediately at the first point that is outside the
 execution of a protected action. If the task is currently on a ready
 queue it is removed and re-entered on to the ready queue determined by the
@@ -470,9 +507,9 @@
 The task at the head of a queue is the one with the earliest deadline.
 
 A task dispatching point occurs for the currently running task @i<T> to
-which policy EDF_Across_Priorities applies whenever:
+which policy EDF_Across_Priorities applies:
 
-@xbullet<a change to the deadline of @i<T> occurs;>
+@xbullet<when a change to the deadline of @i<T> occurs;>
 
 @xbullet<there is a task on the ready queue for the active priority of @i<T>
 with a deadline earlier than the deadline of @i<T>; or>
@@ -483,7 +520,8 @@
 In these cases, the currently running task is said to be preempted and is
 returned to the ready queue for its active priority.
 
-For a task @i<T> to which policy EDF_Across_Priorities applies, the active
+For a task @i<T> to which policy EDF_Across_Priorities applies, the
+base priority is not a source of priority inheritance; the active
 priority when first activated or while it is blocked is defined as the maximum
 of the following:
 
@@ -508,7 +546,7 @@
 as EDF_Across_Priorities, the task is added to the ready queue
 corresponding to its new active priority, as determined above.
 
-For all the operations defined in Ada.Dispatching.EDF, Tasking_Error
+For all the operations defined in Dispatching.EDF, Tasking_Error
 is raised if the task identified by T has terminated. Program_Error
 is raised if the value of T is Null_Task_Id.
 
@@ -529,8 +567,8 @@
 @i<@s8<Documentation Requirements>>
 
 On a multiprocessor, the implementation shall document any conditions that
-cause the completion of the setting of a task's deadline to be delayed later
-than what is specified for a single processor.
+cause the completion of the setting of the deadline of a task to be delayed
+later than what is specified for a single processor.
 
 @xindent<@s9<NOTES@hr
 16 If two adjacent priority ranges, @i<A>..@i<B> and @i<B>+1..@i<C> are
@@ -545,6 +583,45 @@
 existing rules for ceiling locking.>>
 
 
+!corrigendum D.11(4)
+
+@drepl
+After the Hold operation has been applied to a task, the task becomes @i<held>.
+For each processor there is a conceptual @i<idle task>, which is always ready.
+The base priority of the idle task is below System.Any_Priority'First. The
+@i<held priority> is a constant of the type integer whose value is below the
+base priority of the idle task.
+@dby
+After the Hold operation has been applied to a task, the task becomes @i<held>.
+For each processor there is a conceptual @i<idle task>, which is always ready.
+The base priority of the idle task is below System.Any_Priority'First. The
+@i<held priority> is a constant of the type Integer whose value is below the
+base priority of the idle task.
+
+For any priority below System.Any_Priority'First, the task dispatching policy
+is FIFO_Within_Priorities.
+
+!corrigendum D.11(5)
+
+@drepl
+The Hold operation sets the state of T to held. For a held task: the task's own
+base priority does not constitute an inheritance source (see D.1), and the
+value of the held priority is defined to be such a source instead.
+@dby
+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.
+
+!corrigendum D.11(6)
+
+@drepl
+The Continue operation resets the state of T to not-held; T's active priority
+is then reevaluated as described in D.1. This time, T's base priority is taken
+into account.
+@dby
+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.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent