Hard Real – Time Computing System
Database Systems
Symphorien Karl Yoki Donzia
Daegu Catholic University, South Korea
Prof : Dr. Dongmahn Seo
2
CHAPITER 5.
Fixed – Priority Servers
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 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
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
6
Background Scheduling
Background Service Example
Fig.2 Example of Background Scheduling of aperiodic requests under RM
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
8
Polling Server (PS)
Polling Server Example
Fig.3 Example of a Polling Server Scheduled by RM
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.
10
Deferrable Server (DS)
Example of Deferrable Server
Fig.4 Example of a Deferrable Server Scheduled by RM
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
12
Priority Exchange Server
Example of Priority Exchange
Fig.7 Example of Aperiodic Service under a PE Server
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
14
Sporadic Server
Example of Medium – Priority Sporadic Server
Fig.7 Example of Medium – priority Sporadic Server
15
Sporadic Server
Example of High – Priority Sporadic Server
Fig.8 Example of High – priority Sporadic Server
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
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
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
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)
20
Performance Comparison of PS, DS,
PE & SS
Fig.12 Performance results of PS, DS, PE and SS.
21
Performance Comparison of Slack
Stealer wrt background, PS & SS
Fig.13 Performance of the Slack Stealer with respect to background , PS and SS.
22
Summary of Fixed – Priority
Strategis
Fig.14 Evaluation summary of fixed-priority servers.
23

PERIODIC TASK SCHEDULING - Chap.5 Periodic Task Scheduling

  • 1.
    Hard Real –Time Computing System Database Systems Symphorien Karl Yoki Donzia Daegu Catholic University, South Korea Prof : Dr. Dongmahn Seo
  • 2.
    2 CHAPITER 5. Fixed –Priority Servers
  • 3.
    3 Content  BackgroundService (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 forFixed 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 Servicesimply 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
  • 6.
    6 Background Scheduling Background ServiceExample Fig.2 Example of Background Scheduling of aperiodic requests under RM
  • 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
  • 8.
    8 Polling Server (PS) PollingServer Example Fig.3 Example of a Polling Server Scheduled by RM
  • 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.
  • 10.
    10 Deferrable Server (DS) Exampleof Deferrable Server Fig.4 Example of a Deferrable Server Scheduled by RM
  • 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
  • 12.
    12 Priority Exchange Server Exampleof Priority Exchange Fig.7 Example of Aperiodic Service under a PE Server
  • 13.
    13 Sporadic Server  TheSS 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
  • 14.
    14 Sporadic Server Example ofMedium – Priority Sporadic Server Fig.7 Example of Medium – priority Sporadic Server
  • 15.
    15 Sporadic Server Example ofHigh – Priority Sporadic Server Fig.8 Example of High – priority Sporadic Server
  • 16.
    16 Slack Stealing  Noperiodic 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 Exampleof 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 – existenceof 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 – existenceof 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)
  • 20.
    20 Performance Comparison ofPS, DS, PE & SS Fig.12 Performance results of PS, DS, PE and SS.
  • 21.
    21 Performance Comparison ofSlack Stealer wrt background, PS & SS Fig.13 Performance of the Slack Stealer with respect to background , PS and SS.
  • 22.
    22 Summary of Fixed– Priority Strategis Fig.14 Evaluation summary of fixed-priority servers.
  • 23.

Editor's Notes

  • #3 Typical Real-Time systems are hybrids characterized by: periodic tasks that execute critical control activities aperiodic tasks that are event-driven