CVS difference for ais/ai-00355.txt

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

--- ais/ai-00355.txt	2004/10/05 22:49:18	1.7
+++ ais/ai-00355.txt	2004/11/14 06:37:19	1.8
@@ -1,7 +1,8 @@
-!standard D.02.05 (00)                                 04-09-27  AI95-00355/06
+!standard D.02.05 (00)                                 04-11-11  AI95-00355/07
 !standard D.02.01 (01)
 !standard D.02.02 (00)
 !standard D.02.02 (01)
+!standard D.04 (07)
 !class amendment 03-09-27
 !status Amendment 200Y 04-09-27
 !status ARG Approved 9-0-0  04-09-17
@@ -13,7 +14,7 @@
 
 !summary
 
-A means of specifying priority specific dispatching is proposed
+A means of specifying priority specific dispatching is provided
 so that FIFO is not the only 'within_priorities' scheme supported.
 A Round_Robin_Within_Priorities dispatching policy is defined.
 
@@ -21,13 +22,13 @@
 !problem
 
 Although Ada defines a number of mechanisms for specifying
-scheduling policies, only one, FIFO_Within_Priorities is guaranteed
+task dispatching policies, only one, FIFO_Within_Priorities is guaranteed
 to be supported by all implementations of the Real-Time Systems Annex.
-Many applications have a mixture of real-time and non
-real-time activities. The natural way of scheduling non real-time activities
-is by time sharing the processor using Round Robin Scheduling. Currently, the
-only way of achieving this is by incorporating yield (eg delay 0.0) operations
-in the code. This is ad hoc and intrusive.
+Many applications have a mixture of real-time and non-real-time activities.
+The natural way of scheduling non-real-time activities
+is by time sharing the processor using round robin scheduling. Currently, the
+only way of achieving this is by incorporating yield (e.g. delay 0.0)
+operations in the code. This is ad hoc and intrusive.
 
 This AI proposes a new scheduling policy which allows one or more priority
 levels to be identified as round robin priorities. A task whose base priority
@@ -35,8 +36,8 @@
 user-definable quantum.
 
 The method proposed is a general one and will allow any priority
-level/band to have a specific scheme defined (eg FIFO, Round_Robin, EDF,
-etc). This not only extends the facilities of Ada but also provides
+level/band to have a specific scheme defined (e.g. FIFO, Round_Robin, EDF,
+etc.). This not only extends the facilities of Ada but also provides
 a well defined means of combining different dispatching schemes. This is a
 need that is increasingly identified in OS provisions and application surveys.
 
@@ -45,24 +46,24 @@
 Section D.2 (Priority Scheduling) currently (as modified by
 AI-321) has 4 subsections:
 
-2.1 The Dispatching Model
-2.2 Pragma Task_Dispatching_Policy
-2.3 Preemptive Dispatching
-2.4 Non-Preemptive Dispatching
+D.2.1 The Dispatching Model
+D.2.2 Pragma Task_Dispatching_Policy
+D.2.3 Preemptive Dispatching
+D.2.4 Non-Preemptive Dispatching
 
 Two new specific policies are proposed (Round Robin in this AI and EDF
 in AI-357). In addition a means of specifying mixed scheduling is proposed
 in this AI.
 
-This AI deals with modifying 2.2 and 2.3, and adding a new 2.5 (it
-assumes EDF is also to be supported, in 2.6).
+This AI deals with modifying D.2.2 and D.2.3, and adding a new D.2.5 (it
+assumes EDF is also to be supported, in D.2.6).
 
 In addition a new package is added to D.2.1 for parameters
-to dispatching policies.
+of dispatching policies.
 
 !wording
 
-Add before Dynamic Semantics to D.2.1 (as updated by AI-321).
+Add before Dynamic Semantics in D.2.1 (as updated by AI-321).
 
 Static Semantics
 
@@ -82,7 +83,7 @@
 
 This clause 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 distinct dispatching policies.
+split into subranges that are assigned individual dispatching policies.
 
 Syntax
 
@@ -110,8 +111,8 @@
 
 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.
+the value of last_priority_expression shall be greater than or equal
+to that of first_priority_expression.
 
 Static Semantics
 
@@ -139,7 +140,7 @@
 
 If a partition contains one or more Priority_Specific_Dispatching pragmas
 then the Ceiling_Locking policy (see D.3) shall also be specified for
-the partition.
+that partition.
 
 Dynamic Semantics
 
@@ -150,8 +151,8 @@
 Pragma Priority_Specific_Dispatching assigns distinct dispatching policies
 to ranges of System.Any_Priority.
 
-If neither pragma appears in any of the program units comprising a partition,
-the task dispatching policy for that partition is unspecified.
+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
@@ -188,7 +189,7 @@
 D.2.5 Round Robin Dispatching
 
 This clause defines the task dispatching policy
-Round_Robin_Within_Priorities and the package Round_Robin_Dispatching.
+Round_Robin_Within_Priorities and the package Round_Robin.
 
 Static Semantics
 
@@ -199,28 +200,27 @@
 
 with System;
 with Ada.Real_Time;
-package Ada.Dispatching.Round_Robin_Dispatching is
+package Ada.Dispatching.Round_Robin is
   Default_Quantum : constant Ada.Real_Time.Time_Span :=
              <implementation-defined>;
-  procedure Set_Quantum(Pri : System.Priority;
-             Quantum : Ada.Real_Time.Time_Span);
-  procedure Set_Quantum(Low,High : System.Priority;
-             Quantum : Ada.Real_Time.Time_Span);
+  procedure Set_Quantum(Pri : in System.Priority;
+             Quantum : in Ada.Real_Time.Time_Span);
+  procedure Set_Quantum(Low,High : in System.Priority;
+             Quantum : in Ada.Real_Time.Time_Span);
   function Actual_Quantum
            (Pri : System.Priority) return Ada.Real_Time.Time_Span;
   function Is_Round_Robin (Pri : System.Priority) return Boolean;
-end Ada.Dispatching.Round_Robin_Dispatching;
+end Ada.Dispatching.Round_Robin;
 
 When task dispatching policy Round_Robin_Within_Priorities is the single
 policy in effect for a partition, each task with priority in the range of
-System.Interrupt_Priority are dispatched according to policy
+System.Interrupt_Priority is dispatched according to policy
 FIFO_Within_Priorities.
 
 Dynamic Semantics
 
-The procedure Set_Quantum sets the required quantum value
-for the priority level Pri in the first procedure, and priorities in
-the range Low..High in the second procedure. If no quantum is set for
+The procedures Set_Quantum set the required Quantum value for a single level
+Pri or a range of levels Low .. High. If no quantum is set for
 a Round Robin priority level, Default_Quantum is used.
 
 The function Actual_Quantum returns the actual quantum used
@@ -231,7 +231,7 @@
 returns False.
 
 A call of Actual_Quantum or Set_Quantum raises exception
-Ada.Dispatching.Dispatching_Policy_Error if if a predefined policy other than
+Ada.Dispatching.Dispatching_Policy_Error if a predefined policy other than
 Round_Robin_Within_Priorities applies to the specified priority.
 
 For Round_Robin_Within_Priorities, the dispatching rules
@@ -265,8 +265,7 @@
 
 Documentation Requirements
 
-An implementation shall document the range of quanta supported, or the
-distinct values supported.
+An implementation shall document the quantum values supported.
 
 An implementation shall document the accuracy with which it detects the
 exhaustion of the budget of a task.
@@ -274,11 +273,15 @@
 Notes
 
 Due to implementation constraints, the quantum value returned by
-Actual_Quantum might not be identical to that set with Set_Quantum.
+Actual_Quantum might not be identical to the value set by Set_Quantum.
+However, if no value is set by Set_Quantum, then the value returned by
+Actual_Quantum will be identical to that of Default_Quantum.
 
 A task that executes continuously with an inherited priority will not
 be subject to round robin dispatching.
 
+In D.4(7), change "appears in" to "applies to".
+
 !example
 
 To specify round robin dispatching for the lowest priority in a 32-priority
@@ -299,22 +302,33 @@
 if the budget becomes exhausted while executing in a protected object. To
 ensure mutual exclusion, without requiring a further lock, it is necessary to
 allow the task to keep executing within the PO. It will consume more than its
-quantum but the expected behaviour of the system is maintained. The usual
+quantum but the expected behavior of the system is maintained. The usual
 programming discipline of keeping the code within protected objects as short as
-possible will ensure that quantum overrun is minimised. Further support for
+possible will ensure that quantum overrun is minimized. Further support for
 these semantics comes from observing that execution within a PO is
 abort-deferred. Quantum exhaustion is a less severe state than being
-aborted; deferred behaviour thus seems appropriate.
+aborted; deferred behavior thus seems appropriate.
 
-The detailed motivation for this proposal is contained in a paper by Burns
-et al at the 2003 Ada-Europe Conference. It is not repeated here for space
-reasons. The title of the paper is A Round Robin Scheduling Policy for Ada.
+The detailed motivation for this proposal is contained in a paper given
+at the 2003 Ada-Europe Conference. It is not repeated here for space reasons.
+The paper is:
+A. Burns, M. Gonzalez Harbour, A. J. Welling  (2003), "A Round Robin
+Scheduling Policy for Ada" in Reliable Software Technologies Ada-Europe
+2003, LNCS 2655, Springer-Verlag.
 
+
 The proposal is easily implemented on top of the POSIX provision for
 Round Robin scheduling. Indeed it has been implemented in this way by
 Michael Gonzalez Harbour. He reports no difficulty with the implementation.
 
 
+This wording also fixes a wording glitch; pragmas Task_Dispatching_Policy
+and Queuing_Policy are configuration pragmas, and
+thus never appear inside of units; but the last sentence of D.2.2(6) and
+and D.4(7) implies that they do. The Corrigendum fixed this for D.3(6), but
+not the other two cases.
+
+
 !corrigendum D.2.1(01)
 
 @dinsa
@@ -345,18 +359,18 @@
 @dinsb
 @i<@s8<Syntax>>
 
-The form of a pragma Task_Dispatching_Policy is as follows:
+The form of a @fa<pragma> Task_Dispatching_Policy is as follows:
 @dinst
 This clause 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 distinct dispatching policies.
+split into subranges that are assigned individual dispatching policies.
 
 !corrigendum D.2.2(02)
 
 @dinsa
 @fa<@b<pragma> Task_Dispatching_Policy (@i<policy_>identifier);>
 @dinss
-The form of a pragma Priority_Specific_Dispatching is as follows:
+The form of a @fa<pragma> Priority_Specific_Dispatching is as follows:
 
 @fa<@b<pragma> Priority_Specific_Dispatching (@i<policy_>identifier,
 @i<first_priority_>expression, @i<last_priority_>expression);>
@@ -372,10 +386,10 @@
 The @i<policy>_@fa<identifier> shall either be FIFO_Within_Priorities or an
 implementation-defined @fa<identifier>.
 @dby
-The @i<policy>_@fa<identifier> used in a pragma Task_Dispatching_Policy
+The @i<policy>_@fa<identifier> used in a @fa<pragma> Task_Dispatching_Policy
 shall be the name of a task dispatching policy.
 
-The @i<policy>_@fa<identifier> policy_identifier used in a pragma
+The @i<policy>_@fa<identifier> policy_identifier used in a @fa<pragma>
 Priority_Specific_Dispatching shall be the name of a task dispatching policy.
 
 Both @i<first_priority_>@fa<expression> and @i<last_priority_>@fa<expression>
@@ -412,7 +426,7 @@
 
 If a partition contains one or more Priority_Specific_Dispatching pragmas
 then the Ceiling_Locking policy (see D.3) shall also be specified for
-the partition.
+that partition.
 
 !corrigendum D.2.2(06)
 
@@ -432,8 +446,8 @@
 Pragma Priority_Specific_Dispatching assigns distinct dispatching policies
 to ranges of System.Any_Priority.
 
-If neither pragma appears in any of the program units comprising a partition,
-the task dispatching policy for that partition is unspecified.
+If neither @fa<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
@@ -453,8 +467,8 @@
 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.
+An implementation need not support @fa<pragma> Priority_Specific_Dispatching
+if it is infeasible to support it in the target environment.
 
 
 !corrigendum D.2.3(01)
@@ -481,7 +495,7 @@
 @dinsc
 
 This clause defines the task dispatching policy
-Round_Robin_Within_Priorities and the package Round_Robin_Dispatching.
+Round_Robin_Within_Priorities and the package Round_Robin.
 
 @i<@s8<Static Semantics>>
 
@@ -492,7 +506,7 @@
 
 @xcode<@b<with> System;
 @b<with> Ada.Real_Time;
-@b<package> Ada.Dispatching.Round_Robin_Dispatching @b<is>
+@b<package> Ada.Dispatching.Round_Robin @b<is>
   Default_Quantum : @b<constant> Ada.Real_Time.Time_Span :=
              @ft<@i<implementation-defined>>;
   @b<procedure> Set_Quantum (Pri     : @b<in> System.Priority;
@@ -501,18 +515,17 @@
                          Quantum   : @b<in> Ada.Real_Time.Time_Span);
   @b<function> Actual_Quantum (Pri : System.Priority) @b<return> Ada.Real_Time.Time_Span;
   @b<function> Is_Round_Robin (Pri : System.Priority) @b<return> Boolean;
-@b<end> Ada.Dispatching.Round_Robin_Dispatching;>
+@b<end> Ada.Dispatching.Round_Robin;>
 
 When task dispatching policy Round_Robin_Within_Priorities is the single
 policy in effect for a partition, each task with priority in the range of
-System.Interrupt_Priority are dispatched according to policy
+System.Interrupt_Priority is dispatched according to policy
 FIFO_Within_Priorities.
 
 @i<@s8<Dynamic Semantics>>
 
-The procedure Set_Quantum sets the required quantum value
-for the priority level Pri in the first procedure, and priorities in
-the range Low..High in the second procedure. If no quantum is set for
+The procedures Set_Quantum set the required Quantum value for a single level
+Pri or a range of levels Low .. High. If no quantum is set for
 a Round Robin priority level, Default_Quantum is used.
 
 The function Actual_Quantum returns the actual quantum used
@@ -523,7 +536,7 @@
 returns False.
 
 A call of Actual_Quantum or Set_Quantum raises exception
-Ada.Dispatching.Dispatching_Policy_Error if if a predefined policy other than
+Ada.Dispatching.Dispatching_Policy_Error if a predefined policy other than
 Round_Robin_Within_Priorities applies to the specified priority.
 
 
@@ -554,8 +567,7 @@
 
 @i<@s8<Documentation Requirements>>
 
-An implementation shall document the range of quanta supported, or the
-distinct values supported.
+An implementation shall document the quantum values supported.
 
 An implementation shall document the accuracy with which it detects the
 exhaustion of the budget of a task.
@@ -567,6 +579,18 @@
 @xindent<@s9<18 A task that executes continuously with an inherited priority
 will not be subject to round robin dispatching.>>
 
+!corrigendum D.4(7)
+
+@drepl
+Two queuing policies, FIFO_Queuing and Priority_Queuing, are language defined.
+If no Queuing_Policy pragma appears in any of the program units comprising the
+partition, the queuing policy for that partition is FIFO_Queuing. The rules for
+this policy are specified in 9.5.3 and 9.7.1.
+@dby
+Two queuing policies, FIFO_Queuing and Priority_Queuing, are language defined.
+If no Queuing_Policy pragma applies to any of the program units comprising the
+partition, the queuing policy for that partition is FIFO_Queuing. The rules for
+this policy are specified in 9.5.3 and 9.7.1.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent