1/2
This clause defines the task dispatching policy Round_Robin_Within_Priorities and the package Round_Robin.
2/2
The policy_identifier Round_Robin_Within_Priorities is a task dispatching policy.
3/2
The following language−defined library package exists:
4/2
with System; with Ada.Real_Time; package Ada.Dispatching.Round_Robin is Default_Quantum : constant Ada.Real_Time.Time_Span := implementation−defined; 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;
5/2
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 is dispatched according to policy FIFO_Within_Priorities.
6/2
The procedures Set_Quantum set the required Quantum value for a single priority level Pri or a range of priority levels Low .. High. If no quantum is set for a Round Robin priority level, Default_Quantum is used.
7/2
The function Actual_Quantum returns the actual quantum used by the implementation for the priority level Pri.
8/2
The function Is_Round_Robin returns True if priority Pri is covered by task dispatching policy Round_Robin_Within_Priorities; otherwise it returns False.
9/2
A call of Actual_Quantum or Set_Quantum raises exception Dispatching.Dispatching_Policy_Error if a predefined policy other than Round_Robin_Within_Priorities applies to the specified priority or any of the priorities in the specified range.
10/2
For Round_Robin_Within_Priorities, the dispatching rules for FIFO_Within_Priorities apply with the following additional rules:
11/2
12/2
13/2
14/2
15/2
An implementation shall allow, for a single partition, both the task dispatching policy to be specified as Round_Robin_Within_Priorities and also the locking policy (see D.3) to be specified as Ceiling_Locking.
16/2
An implementation shall document the quantum values supported.
17/2
An implementation shall document the accuracy with which it detects the exhaustion of the budget of a task.
NOTES
18/2
16 Due to implementation constraints, the quantum value returned by Actual_Quantum might not be identical to that set with Set_Quantum.
19/2
17 A task that executes continuously with an inherited priority will not be subject to round robin dispatching.