19
Real-Time Systems Real-Time Systems Scheduling Tool Scheduling Tool Developed by Developed by Daniel Ghiringhelli Daniel Ghiringhelli Advisor: Professor J Advisor: Professor J ia ia cun Wang cun Wang December 19, 2005 December 19, 2005

Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Embed Size (px)

Citation preview

Page 1: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Real-Time Systems Real-Time Systems Scheduling ToolScheduling Tool

Developed byDeveloped by

Daniel GhiringhelliDaniel Ghiringhelli

Advisor: Professor JAdvisor: Professor Jiaiacun Wangcun Wang

December 19, 2005December 19, 2005

Page 2: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

OverviewOverview

MotivationMotivation FeaturesFeatures Platform and ToolsPlatform and Tools Software Engineering ApproachSoftware Engineering Approach Algorithm Overview (bonus included!)Algorithm Overview (bonus included!) Tool Design (30,000 ft. view)Tool Design (30,000 ft. view) Tool Overview and DemonstrationTool Overview and Demonstration SummarySummary

Page 3: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

MotivationMotivation Real-time systems: time critical systemsReal-time systems: time critical systems ScheduleSchedule: : assignment of jobs to available assignment of jobs to available

processorsprocessors Feasible scheduleFeasible schedule:: every job completes by its every job completes by its

deadlinedeadline Scheduling algorithms: Scheduling algorithms:

Clock driven / Round-robin /Priority-drivenClock driven / Round-robin /Priority-driven Need a tool to illustrate how these algorithms Need a tool to illustrate how these algorithms

workwork Particularly in RTS classesParticularly in RTS classes

and find feasible schedulesand find feasible schedules Helpful for researchHelpful for research

Page 4: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

FeaturesFeatures Common Common Priority-Driven Priority-Driven Algorithm SupportAlgorithm Support

Earliest Deadline FirstEarliest Deadline First Deadline MonotonicDeadline Monotonic Least Slack FirstLeast Slack First

Hyperperiod calculationHyperperiod calculation Extendable interfaceExtendable interface Simulations based on task specificationsSimulations based on task specifications Graphical user interfaceGraphical user interface

Task managementTask management Visualization of a dynamic schedulerVisualization of a dynamic scheduler

Page 5: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Platform and ToolsPlatform and Tools

Written in Java Written in Java Eclipse 3.0 IDEEclipse 3.0 IDE SWT GUI librarySWT GUI library Deployed as an Deployed as an

executable JARexecutable JAR

Integrated JUnit Testing

Page 6: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Software Engineering Software Engineering PrinciplesPrinciples

Informal processInformal process Frequent ReleasesFrequent Releases GUI Mock-upGUI Mock-up Test DrivenTest Driven Regression TestRegression Test

PolicyPolicy

Initial Mock-up

Page 7: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Software Engineering Software Engineering ApproachApproach

Lightweight V-Model approachLightweight V-Model approach Essentially a waterfall but with User Essentially a waterfall but with User

InvolvementInvolvement No system testing (i.e., “Lightweight”)No system testing (i.e., “Lightweight”)

Test DrivenTest Driven UAT written during RequirementsUAT written during Requirements Unit Tests written during detailed Unit Tests written during detailed

design and constructiondesign and construction Customer CheckpointsCustomer Checkpoints

Page 8: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Lightweight V-ModelLightweight V-Model

Requirements UAT/Deployment

Unit/ComponentTests

Construction

Analysis/Design

Problem Statement

Page 9: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Algorithms Overview: DMAlgorithms Overview: DM Deadline Monotonic (DM)Deadline Monotonic (DM)

Static fixed priority schedulerStatic fixed priority scheduler Immediately pre-empts any running task Immediately pre-empts any running task

with a higher priority taskwith a higher priority task AdvantagesAdvantages

Easy to implement (most widely used)Easy to implement (most widely used) Low system overheadLow system overhead

DisadvantagesDisadvantages Not optimalNot optimal Requires static prioritization before run-timeRequires static prioritization before run-time

Page 10: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Algorithm Overview: EDFAlgorithm Overview: EDF Earliest Deadline First (EDF)Earliest Deadline First (EDF)

Dynamic priority schedulerDynamic priority scheduler Highest priority is assigned to the task with the Highest priority is assigned to the task with the

nearest deadlinenearest deadline AdvantagesAdvantages

EDF theoretically superior to DMEDF theoretically superior to DM Guaranteed scheduleability if CPU utilization Guaranteed scheduleability if CPU utilization

100% or less100% or less DisadvantagesDisadvantages

More difficult to implementMore difficult to implement Higher system overheadHigher system overhead Overloaded system is unpredictable (non-critical Overloaded system is unpredictable (non-critical

tasks may be scheduled before critical tasks)tasks may be scheduled before critical tasks)

Page 11: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Algorithm Overview: LSTF Algorithm Overview: LSTF (bonus!)(bonus!)

Least Slack Time First (LSTF)Least Slack Time First (LSTF) Dynamic priority schedulerDynamic priority scheduler Highest priority given to the task with Highest priority given to the task with

the least slack time (timeToDeadline – the least slack time (timeToDeadline – executionTimeLeft)executionTimeLeft)

AdvantagesAdvantages Same as EDFSame as EDF Intuitively logicalIntuitively logical

DisadvantagesDisadvantages Same as EDFSame as EDF

Page 12: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

EDF and DM ExampleEDF and DM Example

T1

T2

T1

T2

(a) EDF

(b) RM

3 6 9 12

T1=(0, 5, 3, 5), T2=(0, 3, 1, 3)

Page 13: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

RTS Scheduling Tool RTS Scheduling Tool DesignDesign

MVC MVC ArchitectureArchitecture

Controlling Controlling thread polls thread polls simulation simulation thread for thread for model updatesmodel updates

Model

View

Controller

Simulator

CPUQueue

Notifier

status?

ready

ControllingThread

SimulationThread

Page 14: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

RTS Scheduling Tool: RTS Scheduling Tool: Package ViewPackage View

Page 15: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Thread InteractionThread Interaction

rts.SchedulerUI rts.model.TaskSimrts.gui.QueueControl rts.gui.SchedulerControl

getExecutingTask()

getBlockedTasks()

setCurrentTask()

updateTasks()

SchedulerUI.refreshSimGroup = true

currentTask

blockedTasks

Page 16: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Simulator InternalsSimulator Internals

Page 17: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Tool Overview & DemoTool Overview & Demo

Page 18: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

Concluding RemarksConcluding Remarks

RTS Scheduling Tool features:RTS Scheduling Tool features: Friendly UIFriendly UI Effective teaching toolEffective teaching tool Scheduleability analysisScheduleability analysis

Work to be doneWork to be done Additional algorithms can be easily Additional algorithms can be easily

added!added! GUI features and optionsGUI features and options

Page 19: Real-Time Systems Scheduling Tool Developed by Daniel Ghiringhelli Advisor: Professor Jiacun Wang December 19, 2005

AcknowledgmentsAcknowledgments

MU Software Engineering FacultyMU Software Engineering Faculty Professor WangProfessor Wang Professor McDonaldProfessor McDonald