CVS difference for ais/ai-00357.txt

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

--- ais/ai-00357.txt	2004/05/24 22:22:47	1.6
+++ ais/ai-00357.txt	2004/09/09 02:24:20	1.7
@@ -1,4 +1,4 @@
-!standard D.03 (00)                                  04-04-29  AI95-00357/04
+!standard D.03 (00)                                  04-09-06  AI95-00357/05
 !class amendment 03-09-27
 !status work item 03-09-27
 !status received 03-09-27
@@ -9,7 +9,7 @@
 !summary
 
 Direct support for deadlines is defined and a new dispatching policy
-for EDF is supported.
+for Earliest Deadline First (EDF) Scheduling is supported.
 
 !problem
 
@@ -62,8 +62,8 @@
 are followed. But the active priority of a task when executing outside
 a PO may be lower than its base priority (see details below).
 
-To enable a task to be assigned a (non-default) deadline to control
-its activation, a new pragma is provided:
+A new pragma is provided to allow a task to set a (non-default)
+relative deadline to control its activation:
 
 pragma Relative_Deadline(expression);
 where the expected type of expression is Ada.Real_Time.Time_Span.
@@ -74,22 +74,22 @@
 defined: EDF_Across_Priorities.
 
 When the Priority policy EDF_Across_Priorities is in effect the
-following rules apply. Let T'Base be the base priority of task T
-and T'Deadline its absolute deadline.
+following rules apply. Let Base(T) be the base priority of task T
+and Deadline(T) its absolute deadline.
 
 
 Rule 1
 All ready queues in the specified range System.Any_Priority
 are ordered by deadline. For two tasks on the same ready queue,
-S and T: S'Deadline < T'Deadline implies S is closer to the
+S and T: Deadline(S) < Deadline(T) implies S is closer to the
 head of the queue than T.
 
 Rule 2
 When a task T becomes unblocked it is placed on the highest
 priority ready queue R such that
   A protected object with ceiling priority R is currently locked,
-  T'Deadline < Deadline the task locking this protected object, and
-  T'Base > Priority level of R.
+  Deadline(T) < Deadline of the task locking this protected object, and
+  Base(T) > Priority level of R.
 if no such R exists then add T to Any_Priority'first.
 
 Rule 3
@@ -105,21 +105,54 @@
 blocking it is added to the ready queue for its active priority.
 
 Rule 5
-priority ceiling level Priority'first is not allowed.
+Priority ceiling level Priority'first is not allowed.
 
 !wording
 
-D.2.6 Earliest Deadline First Dispatching
+D.2.5 Earliest Deadline First Dispatching
 
-This clause defines the policy_identifier, EDF_Across_Priorities,
-the pragma Relative_Deadline, and package EDF_Dispatching.
+This clause defines a package for representing a task's absolute deadline
+and a dispatching policy that defines Earliest Deadline First (EDF)
+dispatching. A pragma is defined to allow a task to be assigned
+a relative deadline to control its activation.
 
-Post-Compilation Rules
+The absolute deadline of a task is an indication of the urgency of the task.
+Unless otherwise specified, whenever tasks compete for processors or other
+implementation-defined resources, the resources are allocated to the task with
+the earliest absolute deadline.
+
+Static Semantics
+
+The policy_identifier EDF_Across_Priority designates a
+task dispatching policy.
+
+The following language-defined library package exists:
+
+with Ada.Real_Time;
+with Ada.Task_Identification;
+package Ada.Dispatching.EDF_Dispatching is
+  subtype Deadline is Ada.Real_Time.Time;
+  Default_Deadline : constant Deadline :=
+              Ada.Real_Time.Time_Last;
+  procedure Set_Deadline(D : in Deadline;
+              T : in Ada.Task_Identification.Task_ID :=
+              Ada.Task_Identification.Current_Task);
+  procedure Delay_Until_And_Set_Deadline(
+              Delay_Until_Time : in Ada.Real_Time.Time;
+              TS : in Ada.Real_Time.Time_Span);
+  function Get_Deadline(T : in Ada.Task_Identification.Task_ID :=
+              Ada.Task_Identification.Current_Task) return Deadline;
+end Ada.Dispatching.EDF_Dispatching;
 
 If the EDF_Across_Priorities policy is specified for a partition,
 then the Ceiling_Locking policy (see D.3) shall also be specified for the
 partition.
 
+If task dispatching policy EDF_Across_Priorities is in effect for any
+range of priorities within a partition then all tasks in that partition
+have deadline Default_Deadline unless modified by pragma Relative_Deadline
+or calls of Set_Deadline.
+
 Syntax
 
 The form of a pragma Relative_Deadline is as follows:
@@ -136,73 +169,50 @@
 A Relative_Deadline pragma is allowed only immediately within a
 task_definition. At most one such pragma shall appear within a given
 task_definition.
-
-When EDF_Across_Priorities is in effect no protected object shall have
-ceiling priority System.Any_Priority'first.
-
-Static Semantics
 
-The following language-defined library package exist:
+When EDF_Across_Priorities is in effect for priority range Low..High,
+no protected object shall have ceiling priority Low.
+NOT SURE THIS SHOULD BE A LEGALITY RULE AS CEILINGS CAN NOW CHANGE
 
-with Ada.Real_Time;
-with Ada.Task_Identification;
-package Ada.Dispatching.EDF_Dispatching is
-  subtype Deadline is Ada.Real_Time.Time;
-  procedure Default_Deadline : constant Deadline :=
-              Ada.Real_Time.Time_Last;
-  procedure Set_Deadline(D : in Deadline;
-              T : in Ada.Task_Identification.Task_ID :=
-              Ada.Task_Identification.Current_Task);
-  procedure Set_Relative_Deadline(TS : in Ada.Real_Time.Time_Span;
-              T : in Ada.Task_Identification.Task_ID :=
-              Ada.Task_Identification.Current_Task);
-  procedure Delay_and_Set_Relative_Deadline(
-              Delay_Time : in Ada.Real_Time.Time;
-              TS : in Ada.Real_Time.Time_Span);
-  function Get_Deadline(T : in Ada.Task_Identification.Task_ID :=
-              Ada.Task_Identification.Current_Task) return Deadline;
-end Ada.Dispatching.EDF_Dispatching;
-
-
 Dynamic Semantics
 
-The absolute deadline of a task is an indication of the urgency of the task.
-Unless otherwise specified, whenever tasks compete for processors or other
-implementation-defined resources, the resources are allocated to the task with
-the earliest absolute deadline. The initial absolute deadline of a task
-containing pragma Relative_Deadline is the value of Ada.Real_Time.Clock +
-relative_deadline_expression. The call of Ada.Real_Time.Clock being made
-between task creation and the start of its activation. If there is no
-Relative_Deadline pragma then the initial absolute deadline is the value of
-Default_Deadline.
-
-A call of Set_Deadline changes the absolute deadline of the
-task to D. A call of Set_Relative_Deadline changes the absolute
-deadline of the task to Ada.Real_Time.Clock+TS. A call of Get_Deadline
-returns the absolute deadline of the task.
+The initial absolute deadline of a task containing pragma Relative_Deadline
+is the value of Ada.Real_Time.Clock + relative_deadline_expression.
+The call of Ada.Real_Time.Clock being made between task creation and the
+start of its activation. If there is no Relative_Deadline pragma then the
+initial absolute deadline of the task is the value of Default_Deadline.
+
+A call of Set_Deadline changes the absolute deadline of the task to D.
+A call of Get_Deadline returns the absolute deadline of the task.
 
 Setting the task's absolute deadline to the new value takes place as soon as
 is practical but not while the task is performing a protected action.
-
-A call of Delay_and_Set_Relative_Deadline delays the calling task until time
-Delay_Time (equivalent to executing delay until Delay_Time). When the
-task becomes runnable again it will have deadline Delay_Time+TS.
 
-When EDF_Across_Priorities is in effect, modifications to the
-ready queues occur only as follows:
+A call of Delay_Until_And_Set_Deadline delays the calling task until time
+Delay_Until_Time. When the task becomes runnable again it will have deadline
+Delay_Until_Time + TS.
+
+When EDF_Across_Priorities is in effect for priority range Low..High,
+modifications to the ready queues occur only as follows:
+
+o All ready queues in the range Low..High are ordered by deadline.
+  The task at the head of a queue is the one with the earliest
+  absolute deadline.
 
-o All ready queues are ordered by deadline. The task at the
-  head of a queue is the one with the earliest absolute deadline.
-
 o When a task becomes unblocked it is placed on the highest
-  priority ready queue R such that the deadline of the task is
-  earlier than that of any task executing within a protected
-  object with ceiling priority R, and the base priority of the
-  task is greater than R. If no such protected object exists the
-  task is added to the ready queue for Any_Priority'first.
-
-o When the setting of the base priority of a running task takes effect,
-  the task is added to the ready queue determined by the above rule.
+  priority ready queue with priority R such that:
+     i)   a task is executing within a protected object with ceiling
+          priority R,
+     ii)  the unblocked task has an earlier deadline than any task
+          executing within a protected object with ceiling
+          priority R, and
+     iii) the base priority of the unblocked task is greater than R.
+  If no such protected object exists the task is added to the ready
+  queue for Low.
+
+o When the setting of the base priority (to a value in the range
+  Low..High) of a running task takes effect, the task is added to
+  the ready queue determined by the preceding rule.
 
 o When a task is chosen for execution it runs with the active priority
   determined by the ready queue from which the task was taken. If
@@ -232,13 +242,18 @@
 
 Notes
 
+If two adjacent priority ranges, A..B and B+1..C are allocated policy
+EDF_Across_Priorities then this is not equivalent to a single range, A..C.
+For policies FIFO_Within_Priorities and Round_Robin_Within_Priorities they
+are equivalent.
+
 The above rules implement the preemption-level protocol (also called
-Stack Resource Policy) protocol for resource sharing under EDF
+Stack Resource Policy protocol) for resource sharing under EDF
 dispatching. The preemption-level for a task is denoted by its base
 priority. The definition of a ceiling preemption-level for a protected
 object follows the existing rules for ceiling locking.
 
-An implementation may support addition dispatching policies by replacing
+An implementation may support additional dispatching policies by replacing
 absolute deadline with an alternative measure of urgency.
 
 !discussion
@@ -278,8 +293,8 @@
 level). Moreover no higher pri q is appropriate as one of the
 conditions will be false.
 
-Note to be placed on a ready q, T must have a strictly higher
-preemption level (base priority) than the task on that q that
+Note that in order to be placed on a ready q, T must have a strictly
+higher preemption level (base priority) than the task on that q that
 is holding the lock. Hence mutual exclusion is not broken by
 the preemption rules.
 
@@ -287,7 +302,7 @@
 
 During discussions an alternative way of expressing this model
 was considered. This did not need the 'no POs at level Priority'first'
-rule. But it did required that tasks be placed at one above
+rule. But it did require that tasks be placed at one above
 the level in the above model, and required the rule that a
 task preempted while executing in a PO must always stay
 at the front of its ready q even if its deadline is later than

Questions? Ask the ACAA Technical Agent