Version 1.2 of ais/ai-00357.txt

Unformatted version of ais/ai-00357.txt version 1.2
Other versions for file ais/ai-00357.txt

!standard D.03 (00)          03-09-27 AI95-00357/01
!class amendment 03-09-27
!status work item 03-09-27
!status received 03-09-27
!priority Medium
!difficulty Medium
!subject Support for Deadlines and Earliest Deadline First Scheduling
Direct support for deadlines is defined and a new dispatching policy for EDF is provided.
Ada does not give any direct support for deadlines (although they are the most important notion in real-time systems). A standard way of representing deadlines via a predefined attribute of a task is needed.
Once deadlines are supported it is possible to define a dispatching policy for EDF scheduling. This being as common an approach as fixed priority scheduling for real-time system. It has the advantage that higher levels of resource utilization are possible.
It is important that EDF works with priorities and hence a combined scheme via Priority_Specific scheduling is defined.
First support for deadlines. The following package is provided:
with Ada.Task_Attributes; package Ada.Real-Time.Deadline_Support is package Deadline is new Ada.Task_Attributed(Time, Time_Last); end Ada.Real_Time.Deadline_Support;
To enable a task to be assigned (a non-default) deadline to control its activation a new pragmas is provided;
pragma Deadline(expression); where the expected type of expression is Ada.Real_Time.Time.
This pragma can only occur in the specification part of a task.
A task can change its current deadline by use of the attribute operations: Deadline.Set_Value and read the current deadline via Deadline.Value.
To support EDF scheduling a new Priority_Policy identifier is defined: EDF_Within_Priority. If this policy is in effect then the Task_Dispatching_Policy must be Priority_Specific and the Locking_Policy must be Preemption_Level_Within_Ceiling_Locking.
When the Priority policy EDF_Within_Priority is in effect for priority level P the ready queue for P is ordered by the deadline attribute, with the head of the queue being the task with the earliest deadline value.
Modifications to the ready queues occur as follows:
o when a blocked task becomes ready it is added to the ready queue for priority P at the position dictated by its deadline attribute
o when a task executes a delay_statement that does not result in blocking it is added to the ready queue at the position dictated by its deadline attribute
o when a task has its base priority changes and as a result joins the ready queue for priority P it is added to the ready queue at the position dictated by its deadline attribute
Each of the events specified above is a task dispatching point (see D.2.1).
A task dispatching point occurs for the currently running task with base priority P whenever there is a task on the ready queue for P with a shorter deadline and with a preemption level higher than the preemption level of any protected object in use by tasks of priority P. The currently running task is said to be preempted and is added to the ready queue at the position dictated by its deadline attribute.
!ACATS test
Tests should be created to check on the implementation of this feature.


Questions? Ask the ACAA Technical Agent