This document discusses various techniques for scheduling aperiodic tasks alongside periodic real-time tasks, including background scheduling, polling servers, deferrable servers, priority exchange servers, sporadic servers, and slack stealing. It provides examples and compares the performance of each technique. In particular, it shows that no optimal algorithm exists that can minimize the response time of every aperiodic request given a set of periodic tasks. Different scheduling algorithms provide better response times for aperiodic tasks at the cost of increased complexity.
3. 3 Content
Background Service (FIFO as availability permits)
Polling Server, (Pseudo periodic task provides slot for serving aperiodic task)
Deferrable Server, (Unused capacity is saved for future aperiodic arrivals)
Priority Exchange Server, (Loans unusable capacity to ready periodic tasks)
Sporadic Server, (Loans unusable capacity to ready periodic task and delays recoup)
Slack Stealing, (Passive task steals unnecessary slack in scheduling)
Non-existence of Optimal Severs
Summary
4. 4 Assumptions for Fixed Priority Servers
Periodic tasks scheduled by a fixed priority algorithm
(specifically rate monotonic)
All periodic tasks start simultaneously at time t = 0 , (deadline = period )
Arrival times of periodic requests are unknown
When not explicitly specified, the minimum inter arrival time
of a sporadic task is assumed to be equal to its deadline
All tasks are fully preemptable
5. 5
Background Scheduling
Background Service simply queues up aperiodic tasks & services them
perhaps on a FIFO basis. There are no guarantees.
Fig.1 Scheduling queues required for background Scheduling
Advantages : Simple , Can use alternate scheduling algorithm for aperiodic tasks
Disadvantage : No inherent guarantees
7. 7
Polling Server (PS)
The simplest variant of server
When active then serve pending aperiodic request within its capacity
No aperiodic requests are pending SUSPEND
Advantages : Relatively easy to implement
Disadvantage : Not a big advantage in performance
9. 9
Deferrable Server (DS)
Similar to Polling Server
If no aperiodic requests are pending :
• Suspend itself
• Preserve Capacity until the end of the period
• If aperiodic request arrives later during the period then it is served
At the beginning of the period capacity is fully replenished
Advantages : Much better response time for aperiodic tasks compared to PS
Disadvantage : More complex and DS violated the RM principle that the highest
priority task runs when it is ready.
11. 11
Priority Exchange Server
Periodic server with high priority
Preserves capacity by exchanging it for the execution time of a lower-priority
task :
• At the beginning of the period : replenish the capacity
• Aperiodic requests are pending : serve them
• No aperiodic requests are pending : exchange execution time with
the active periodic task with the highest priority
The priority exchange is performed repeatedly
Advantages : Provides better Schedulability bound for periodic requests
Disadvantage : Provides worse response for aperiodic tasks compare to DS
13. 13
Sporadic Server
The SS algorithm creates a high-priority task for serving aperiodic requests and,
like DS, it preserves the server capacity at its high-priority level until an
aperiodic request occurs.
SS replenishes its capacity only after it has been consumed by aperiodic task
execution :
• Pexe(: priority level of the task which is currently executing)
• Ps(:the priority level associated with SS)
• Active (: SS is said to be active when Pexe ≥ Ps )
• Idle (: SS is said to be idle when Pexe ≤ Ps )
• RT (: Replenishment time at which the SS capacity will be replenished
• RA (: Replenishment amount that will be added to the capacity at the time
16. 16
Slack Stealing
No periodic server ; passive task Slack Stealer
Slack
Main idea :
• No benefit in early completion of periodic tasks
• When aperiodic request arrives : steal available slacks
Better responsiveness, more complicated schedulability analysis
Advantages : Substantial improvement in aperiodic task response time
Disadvantage : Complexity
17. 17
Slack Stealing
Fig.9 Example of Slack Stealer behavior :
a) when no aperiodic requests are pending;
b) when an aperiodic request of three units arrives at time t = 8.
Example of Slack Stealing
18. 18
Non – existence of Optimal Servers
Theorem
For any set of periodic tasks ordered on a given fixed – priority scheme and
aperiodic requests ordered according to a given aperiodic queueing discipline,
there does not exist any valid algorithm that minimizes the response time of
every soft aperiodic request.
Similarly for average response time.
19. 19
Non – existence of Optimal Servers
Example to Show Non-existence of Optimal Server
Fig.11 No algorithm can minimize the response time of every aperiodic request.
If J1 is minimized, J2 is not (b)
If J2 is minimized, J1 is not (c)