object-oriented design and implementation of the oe-scheduler in real-time environments ilhyun lee...
TRANSCRIPT
Object-Oriented Design and Implementation of the OE-Scheduler in Real-time Environments
Ilhyun Lee Cherry K. Owen Haesun K. Lee
The University of Texas of the Permian Basin
Outline
Introduction Motivation and Objective UML Diagram for OE-Scheduler Implementation for OE-Scheduler Conclusion Future Work
Introduction
Real-Time System Periodic Task Model Object Oriented Design OE-Scheduler
Real-Time System
Computing system with a set of execution models that have timing constraints
Hard Real-Time System Soft Real-Time System
Hard Real-Time System
System Value Time
Start Time Deadline
Soft Real-Time System
System Value Time Start Time Deadline
Periodic Task Model
A sequence of the same type of event occurring at constant intervals
Task : scheduling entity Event : recurring instance of scheduling entity
Event 1 Event 2 Event 3 Event 4 Time constant interval
Object Oriented Design
Problems are modeled using objects The object-oriented approach has the
potential to reduce complexity, improve flexibility, and reduce expenses
Object reusability
OE-Scheduler
Scheduler that generates a schedule of periodic tasks by the principle of eliminating unnecessary context switches under the rate monotonic algorithm
Guarantee the hard deadlines of an arbitrary number of periodic tasks in hard real-time environments
Object-oriented design
Motivation
Future real-time system will run in highly dynamic behavior environments
Current our procedural scheduling algorithms cannot be efficiently applied to future real-time system
This observation motivated us to work on developing an object-oriented view-point of the OE-scheduler in hard real-periodic environments
Objective
Developing an object-oriented view-point of the OE-scheduler that generates a schedule of periodic tasks by the principle of eliminating unnecessary context switches under the rate monotonic algorithm in hard real-periodic environments
UML Diagram for OE-Scheduler
Class Diagram for OE-Scheduler Sequence Diagram to Produce a OE-
Schedule
Class Diagram for OE-Scheduler
+Methods()
-Attributes
Periodic Task
+Methods()
-Attributes
RM Scheduler
+Methods()
-Attributes
OE-Scheduler
+Methods()
-Attributes
OE-Schedule
+Methods()
-Attributes
CRP-Slack
1
1..*
1 11..* 1
Sequence Diagram to Produce a OE-Schedule
Peridoc Task OE_Scheduler RM_Scheduler OE-Schedule
Request scheduling
Request CRP and Slack
Notify
Produce OE-Schedule
CRP-Slack
Notify
Request RM Information
Implementation for OE-Scheduler
Scheduling algorithm for OE-Scheduler Test result of the object-oriented OE-
Scheduler Comparison table
Scheduling Algorithm for OE-Scheduler
Step1. If Pij {i: 1..n, j: 0..n} arrives the system at the
same time, pick the highest priority event of Pij {i: 1..n, j: 0..n}. Determine the Current Request
Period (CRP) of the selected event.
Scheduling Algorithm for OE-Scheduler
Step2. If the CRP of the selected event is odd, then go to Step3. Otherwise, if the CRP of the selected event is even, then calculate the Slack, the maximum amount of time that a scheduler can delay running the task without missing its current deadline, for the selected event. Delay the execution of the selected event until the Slack of the selected event becomes empty. When the Slack of the selected event becomes empty, schedule the selected event under the Rate Monotonic Algorithm. Go to Step4
Scheduling Algorithm for OE-Scheduler
Step3. Immediately schedule the selected event under the Rate Monotonic Algorithm.
Step4. Go to Step1 until the final event is processed
Scheduling Algorithm for OE-Scheduler
Reference [1] Haesun Kang Lee, Ilhyun Lee, and Martha Evens “Scheduling Periodic Tasks with Reduced Context Switches,” Proceedings of the ACIS 1st International Conference on Software Engineering Applied to Networking & parallel/Distributed Computing (SNPD ’00), pp. 209-215, May 18-21, 2000, Champagne-Ardenne, France.
Test Result of the Object-oriented OE-Scheduler
Record structure of the periodic task Workload file: OE-schedule.txt Menu-based user interface The scheduling points with CRP Schedule for 4 periodic task by OE-
Scheduler
Record Structure of the Periodic Task Workload
<PID, PE. P, AT> where, PID: Process-Id of periodic task, an integer number PE: Execution time of periodic task P: Period of periodic task AT: The arrival time of the periodic process, an integer value greater than or equal to 0
Workload File: OE-schedule.txt
Workload File: 1 // Periodic task #1 1 4 0 2 // Periodic task #2 1 8 0 3 // Periodic task #3 2 10 0 4 // Periodic task #4 5 20 0
Menu-based User Interface
1. Generate Workload file 2. Produce the scheduling points with CRP 3. Run OE-Scheduler 4. Exit
The Scheduling Points with CRP
Tasks Arrival Time Current Request Period of Pij
P10 0 even P20 0 even P30 0 even P40 0 even P11 4 odd P12 8 even P21 8 odd P31 10 odd P13 12 odd P14 16 even P22 16 even P15 20 odd P32 20 even P41 20 odd P16 24 even P23 24 odd P17 28 odd P33 30 odd P18 32 even P24 32 even P19 36 odd
Schedule for 4 Periodic Task by OE-Scheduler
Schedule for 4 periodic task by OE-Scheduler Time Instance Context-Switch 0 Idle No 1 Idle No 2 Idle No 3 P10 Yes 4 P11 No 5 P20 Yes 6 P30 Yes 7 P30 No 8 P21 Yes 9 P40 Yes 10 P31 Yes 11 P12 Yes 12 P13 No 13 P31 Yes 14 P40 Yes 15 P40 No 16 P40 No 17 P40 No 18 Idle No 19 P14 Yes 20 P15 No
Schedule for 4 periodic task by OE-Scheduler
21 P22 Yes 22 P41 Yes 23 P32 Yes 24 P23 Yes 25 P32 Yes 26 P41 Yes 27 P16 Yes 28 P17 No 29 P41 Yes 30 P33 Yes 31 P33 No 32 P41 Yes 33 P41 No 34 Idle No 35 P18 Yes 36 P19 No 37 P24 Yes* 38 Idle No 39 Idle No 40 Idle No * 2 context switches occur except the last instance
Comparison Table
Number of context switches for times 0 to 40
Time 0 6 12 18 24 30 36 40 Algorithm
RMA 0 9 15 23 29 39 47 49 EDFA 0 9 15 23 29 39 47 49 OE 0 3 13 17 25 35 41 43
Conclusion
A study of dynamic behavior property in hard real-time environments
Robust design facilitates easier extension of the system to include more dynamic environments
Provide the real-time system engineers with greater flexibility to design future real-time systems
Helping the designer of real-time operating systems
Future Work
Extend our scheduling algorithms to distributed and multiprocessor environments