SlideShare a Scribd company logo
N O T A T I O N S A N D A S S U M P T I O N
S T A T I C , T I M E R - D R I V E N S C H E D U L E R
G E N E R A L S T R U C T U R E O F C Y C L I C S C H E D U L E
C Y C L I C E X E C U T I V E S
I M P R O V I N G T H E A V E R A G E R E S P O N S E T I M E O F A P E R I O D I C
J O B S
S C H E D U L I N G S P O R A D I C J O B S
P R A C T I C A L C O N S I D E R A T I O N S A N D G E N E R A L I Z A T I O N
A L G O R I T H M F O R C O N S T R U C T I N G S T A T I C S C H E D U L E S
P R O S A N D C O N S O F C L O C K - D R I V E N S C H E D U L I N G
Clock Driven Scheduling
Assumptions
 To represent the clock driven scheduling following
assumptions are used:
 System should be deterministic
 All parameters of periodic task are known priori
 Fixed number of periodic task in system
 Variation in inter release time is negligible
 For task Ti each job Ji,k is ready for execution at its release
time ri,k and released Pi units after previous jobs in Ti
i.e ri,k=ri,k-1+Pi
 Aperiodic jobs may exist and may released at
unexpected time. Assumption made for them are:
 System make a single queue for them
 Whenever processor is available for them, job at the head of
the queue is executed
Notations
 Special notation which consists of four parameters
 Ti=(фi , Pi , ei , Di)
 Ti is periodic task
 фi is phase of task
 Pi is the period of task
 ei is execution time of the task
 Di is the relative deadline of task
 Example :
Ti=(1,10,3,6)
 Phase is 1, period is 10, execution time is 3 and relative
deadline is 6
 First job is released and ready at time 1
 Must be completed by time 7
 Second job is ready at 11
 Must be completed by 17 and so on
 Default value of phase is 0
 Ti=(10,3,6)
 Phase is 0
 Period is 10
 Execution time is 3
 Relative Deadline is 6
 Default value of relative deadline is the period of the task
 Ti=(10,3)
 Phase is 0
 Period is 10
 Execution time is 3
 Relative Deadline is 10
Static , Timer-Driven Scheduler
 When all the parameters of the job are known, the
static schedules of the job can be developed offline
 Processor time allocated to the job is its maximum
execution time
 Scheduler dispatches the jobs according to the static
schedule, repeating the jobs at each hyper-period
 Static schedules guarantee that each job completes
by its deadline
 Let us consider four independent periodic task
T1=(4,1), T2=(5,1.8), T3=(20,1) and T4=(20,2)
 Their utilization are 0.25, 0.36, 0.05 and 0.1
respectively and total utilization is 0.76
 Since LCM of periods is 20, hyper period is 20
 Entire schedule consists of replicated segments of
length 20
 Some periods are not used by the task.
 These can be used by aperiodic jobs and background
non-relative jobs
 Static cyclic schedules can be implemented by using
algorithm
 The algorithm stores the pre-computed schedule as a
table
 For given task table has 17 entries as shown below:
K Tk T(tk)
0 0.0 T1
1 1.0 T3
2 2.0 T2
3 3.8 I
4 4.0 T1
5 5.0 I
6 6.0 T4
7 8.0 T2
8 9.8 T1
9 10.8 I
10 12 T2
11 13.8 T1
12 14.8 I
13 16.0 T1
14 17.0 I
15 18.0 T2
16 19.8 I
 Table has 17 entries
 tk is decision time
 T(tk) is the task to be executed or idle interval(I)
 During initialization system creates all the task to be
executed
 At every decision time scheduler decide T(tk) and
sets timer to interrupt at next decision time
 It then suspend itself and allow the processor to
execute the task
General Structure of Cyclic Schedulers
 Arbitrary cyclic schedules are flexible but inefficient.
 They depend on accurate time interrupt and high
scheduling overloads
 So clock driven approach is implemented using
structural approach rather than tabular approach
 Scheduling decision time partition time line into
intervals called frames
 Scheduling decision are made at the beginning of
every frame.
 There is no preemption within each frame.
 First job of every task is released at the beginning of
the frame.
 The phase of each periodic task is non-negative
integer multiple of frame size
 фi=k.f
 Gives two benefits
 Scheduler can easily check for overrun and missed deadline at
the end of each frame
 Can use periodic clock interrupt rather than programmable
timer.
Clock driven scheduling
Frame Size Constraints
 To avoid preemption, the frame size should be long
enough so that every job start and complete within
single frame.
f ≥ max(e1,e2………en)
 Hyper period should be an integer multiple of the
frame size to minimize the entries.
 There should be at least one frame between release
and deadline of the job so that scheduler can check if
the job has been completed by its deadline
 Example: Consider T1=(4,1.0) , T2=(5,1.8) ,
T3=(20,1.0) and T4=(20,2.0)
 Solution:
 H=LCM of 4,5,20 and 20=20
 Max of 1.0, 1.8, 1.0 and 2.0 is 2.0
i) f≥2
ii) f is either (2,4,5,10,20)
iii) 2f-gcd(Pi,f)≤Di
 For f=2
 For T1 Pi=4 and Di=4
2*2-gcd(4,2)≤4
4-2≤4
2≤4 (TRUE)
 Third condition is satisfied by all the task
 F0r f=4,5,10 and 20
 Third condition is not satisfied by all the task
 Hence the required frame size is 2
Job Slices
 Consider three independent tasks T1(4,1), T2(5,2,7)
and T3(20,5)
 f ≥ 5
 Since H is 20, f is either 2,4,5,10,20
 2f- gcd(Pi,f) ≤4
≤7
≤20
All the three conditions are not satisfied.
 From above example we see that sometime all the
three condition are not satisfied by the task.
 In such case job with the largest execution time is
sliced into sub-jobs with shorter execution time.
 Since period of T1 is 4, all five frames are used by it
while T2 uses only 4 frames.
 So in above example we divide T3(20,5) into chain of
three slices as (20,1) , (20,3) and (20,1)
 To construct the cyclic schedule we need to make
three design constraints
 Choose the frame size based on frame constraints
 Slice the jobs
 Places the slices in frames
 These decision cannot be taken independently
 Ideally we want as few slices as possible, but forced to generate
more slices in order to get the feasible schedule.
Cyclic Executives
Improving Average Response of Aperiodic Jobs
 Aperiodic job is released and executed in response to
an event.
 Sooner the job is completed more responsive the
system is.
 So minimizing the response time of each aperiodic
jobs and average response of all aperiodic jobs is one
of design goals.
 There is no advantage in giving priority to aperiodic
jobs and no advantage in completing the job with
hard deadline early.
Slack Stealing
Clock driven scheduling
 Figure (a) shows the first major cycle in the cyclic
schedule of the periodic tasks
 Figure (b) shows three aperiodic jobs A1, A2 and A3
 Figure (c) shows when the aperiodic jobs executed
when if we use cyclic executive
 Figure (d) shows slack stealing
 Before Slack Stealing response time of:
 A1 is 6.5
 A2 is 1.5
 A3 is 5.5
 After slack stealing response time of:
 A1 is 4.5
 A2 is 0.5
 A3 is 2.5
Clock driven scheduling
EDF Scheduling of Accepted jobs
 EDF algorithm is a good way to schedule the
sporadic jobs.
 Scheduler maintains the queue of accepted sporadic
jobs in increasing order of their deadlines.
 It inserts all the newly accepted sporadic in the
queue in the same order.
 Below is the example using frame size 4.
Clock driven scheduling
Practical Consideration and Generalization
 The practical problem faced in clock-driven system
mainly fall into three categories
 How to handle frame overrun?
 How to do mode change?
 How to schedule task in multiprocessor system?
Handling Frame Overrun
 The frame overrun can occur due to:
 Input data dependency
 Hardware failure
 Software flaws
 Frame overrun can be avoided by:
 Killing the job that is overrun and starting an error recovery
task
 Preempting the job and scheduling the remaining job as the
aperiodic job
 Continue to execute the offending job. The start of the next
frame and the execution of jobs in next frame are delayed.
Mode Changes
 The number of jobs are fixed in particular mode.
 Whenever the mode changes the new jobs may be
added or old may be deleted. So new table must be
brought into memory along with the code of the task.
 Mode change job is released in response to the mode
change command.
 We assume that periodic tasks are independent and
hence can be added and deleted independently.
Aperiodic Mode Change
 A way to schedule the mode change job is to treat it
like the ordinary aperiodic job.
 Except that it may be given highest priority and
executed ahead of other aperiodic jobs.
 Once the job execute it begin to modify the old
schedule in order to speed up the mode change.
 Periodic task that will not be executed in new mode
is deleted and its memory space and processor time
is freed as soon as current job in the task completes.
Sporadic Mode Change
 Sporadic job has to be completed by its deadline.
 There are two possible way to schedule:
 We can treat it like any ordinary sporadic jobs and schedule it.
 If the job is not schedulable it can be rejected or the mode
change job can be postponed
General Workloads and Multiprocessor
Scheduling
 As long as all the parameters of the jobs are known
priori, a static schedule can be computed offline.
 It is then stored in tabular form.
 Now global schedule can be constructed which
specify on which processor job executes and when.
 It is more complex to implement.
Clock driven scheduling
Algorithm for Constructing Static Schedules
 Iterative Network Flow(INF) Algorithm is used to
find out the feasible cyclic schedule if one exist.
 It assumes that task can be preempeted at any time
and are independent.
 In order to apply the INF we first have to find out the
frame size of the system.
 Consider three independent tasks T1(4,1), T2(5,2,7)
and T3(20,5)
 Frame size possible are 2 and 4 which still does not
satisfy the first requirement.
 INF tries to find the feasible cyclic schedule for
possible frame size starting from the largest one.
 If the algorithm fails to find one , then we can say
that no feasible schedule exist even when the job is
divided into sub-jobs.
 The major component of INF is network flow graph
 The constraints on which jobs can be scheduled are
represented by network flow graph.
 It contains following vertices and edges:
Clock driven scheduling
 A flow of an edge is a non-negative number satisfying
the following conditions:
 It is not greater than the capacity of the edge.
 With the exception of source and sink , the sum of the flows of
all the edges into every vertex is equal to the sum of flows of all
the edges out of the vertex
Clock driven scheduling
 Consider three independent tasks T1(4,1), T2(5,2,7)
and T3(20,5)
 Frame size possible are 2 and 4 which still does not
satisfy the first requirement.
 We use INF to find the feasible algorithm.
 We draw the network flow graph for frame size 4.
Clock driven scheduling
Clock driven scheduling
Clock driven scheduling
Clock driven scheduling
Clock driven scheduling
Clock driven scheduling

More Related Content

PPTX
Approaches to real time scheduling
PPTX
Cpu scheduling
PPTX
Operating Systems: Device Management
PPTX
Multi processor scheduling
PPTX
PDF
Cs8493 unit 1
PPTX
Os unit 3
PPTX
Distributed Systems Introduction and Importance
Approaches to real time scheduling
Cpu scheduling
Operating Systems: Device Management
Multi processor scheduling
Cs8493 unit 1
Os unit 3
Distributed Systems Introduction and Importance

What's hot (20)

PDF
Real Time Systems
PPTX
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
PPTX
Recognition-of-tokens
PDF
Lecture Notes-Are Natural Languages Regular.pdf
PPT
Rtos Concepts
PDF
Token, Pattern and Lexeme
PDF
Syntax Directed Definition and its applications
PDF
I. AO* SEARCH ALGORITHM
PPTX
Process synchronization in Operating Systems
PPTX
Process management os concept
PPTX
Page replacement algorithms
PDF
OS - Process Concepts
PPTX
Assembly Language
PPTX
Asymptotic Notation and Data Structures
PDF
Time and Space Complexity
PPTX
Job sequencing with deadline
PPTX
Lexical analyzer generator lex
PDF
Working principle of Turing machine
PPT
Formal Specification in Software Engineering SE9
PPTX
Artificial Intelligence Searching Techniques
Real Time Systems
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
Recognition-of-tokens
Lecture Notes-Are Natural Languages Regular.pdf
Rtos Concepts
Token, Pattern and Lexeme
Syntax Directed Definition and its applications
I. AO* SEARCH ALGORITHM
Process synchronization in Operating Systems
Process management os concept
Page replacement algorithms
OS - Process Concepts
Assembly Language
Asymptotic Notation and Data Structures
Time and Space Complexity
Job sequencing with deadline
Lexical analyzer generator lex
Working principle of Turing machine
Formal Specification in Software Engineering SE9
Artificial Intelligence Searching Techniques
Ad

Similar to Clock driven scheduling (20)

PDF
6_RealTimeScheduling.pdf
PPTX
Priority driven scheduling of periodic tasks
PDF
Periodic
PDF
slot_shifting
PPT
ESC UNIT 3.ppt
PDF
capacityshifting1
PPTX
Flowshop scheduling
DOCX
20118016 aryan sabat study and analysis of scheduler design
PPTX
Reference model of real time system
PPTX
Round robin scheduling
PPTX
Real Time System
PPT
Real time scheduling - basic concepts
PDF
Embedded Recipes 2017 - Understanding SCHED_DEADLINE - Steven Rostedt
PDF
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
PPTX
Commonly used Approaches to Real Time Scheduling
PDF
Real time Systems lecture slides (Complete)
PDF
Real Time most famous algorithms
PPTX
Scheduling
PPTX
scheduling.pptx
PPT
task_sched2.ppt
6_RealTimeScheduling.pdf
Priority driven scheduling of periodic tasks
Periodic
slot_shifting
ESC UNIT 3.ppt
capacityshifting1
Flowshop scheduling
20118016 aryan sabat study and analysis of scheduler design
Reference model of real time system
Round robin scheduling
Real Time System
Real time scheduling - basic concepts
Embedded Recipes 2017 - Understanding SCHED_DEADLINE - Steven Rostedt
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
Commonly used Approaches to Real Time Scheduling
Real time Systems lecture slides (Complete)
Real Time most famous algorithms
Scheduling
scheduling.pptx
task_sched2.ppt
Ad

More from Kamal Acharya (20)

PPTX
Programming the basic computer
PPTX
Computer Arithmetic
PPTX
Introduction to Computer Security
PPTX
Session and Cookies
PPTX
Functions in php
PPTX
Web forms in php
PPTX
Making decision and repeating in PHP
PPTX
Working with arrays in php
PPTX
Text and Numbers (Data Types)in PHP
PPTX
Introduction to PHP
PPTX
Capacity Planning of Data Warehousing
PPTX
Data Warehousing
PPTX
Search Engines
PPTX
Web Mining
PPTX
Information Privacy and Data Mining
PPTX
Cluster Analysis
PPTX
Association Analysis in Data Mining
PPTX
Classification techniques in data mining
PPTX
Data Preprocessing
PPTX
Introduction to Data Mining and Data Warehousing
Programming the basic computer
Computer Arithmetic
Introduction to Computer Security
Session and Cookies
Functions in php
Web forms in php
Making decision and repeating in PHP
Working with arrays in php
Text and Numbers (Data Types)in PHP
Introduction to PHP
Capacity Planning of Data Warehousing
Data Warehousing
Search Engines
Web Mining
Information Privacy and Data Mining
Cluster Analysis
Association Analysis in Data Mining
Classification techniques in data mining
Data Preprocessing
Introduction to Data Mining and Data Warehousing

Recently uploaded (20)

PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Insiders guide to clinical Medicine.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Business Ethics Teaching Materials for college
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
master seminar digital applications in india
PPTX
Cell Types and Its function , kingdom of life
human mycosis Human fungal infections are called human mycosis..pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
TR - Agricultural Crops Production NC III.pdf
Final Presentation General Medicine 03-08-2024.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Microbial diseases, their pathogenesis and prophylaxis
Anesthesia in Laparoscopic Surgery in India
Insiders guide to clinical Medicine.pdf
O7-L3 Supply Chain Operations - ICLT Program
Business Ethics Teaching Materials for college
102 student loan defaulters named and shamed – Is someone you know on the list?
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
master seminar digital applications in india
Cell Types and Its function , kingdom of life

Clock driven scheduling

  • 1. N O T A T I O N S A N D A S S U M P T I O N S T A T I C , T I M E R - D R I V E N S C H E D U L E R G E N E R A L S T R U C T U R E O F C Y C L I C S C H E D U L E C Y C L I C E X E C U T I V E S I M P R O V I N G T H E A V E R A G E R E S P O N S E T I M E O F A P E R I O D I C J O B S S C H E D U L I N G S P O R A D I C J O B S P R A C T I C A L C O N S I D E R A T I O N S A N D G E N E R A L I Z A T I O N A L G O R I T H M F O R C O N S T R U C T I N G S T A T I C S C H E D U L E S P R O S A N D C O N S O F C L O C K - D R I V E N S C H E D U L I N G Clock Driven Scheduling
  • 2. Assumptions  To represent the clock driven scheduling following assumptions are used:  System should be deterministic  All parameters of periodic task are known priori  Fixed number of periodic task in system  Variation in inter release time is negligible  For task Ti each job Ji,k is ready for execution at its release time ri,k and released Pi units after previous jobs in Ti i.e ri,k=ri,k-1+Pi
  • 3.  Aperiodic jobs may exist and may released at unexpected time. Assumption made for them are:  System make a single queue for them  Whenever processor is available for them, job at the head of the queue is executed
  • 4. Notations  Special notation which consists of four parameters  Ti=(фi , Pi , ei , Di)  Ti is periodic task  фi is phase of task  Pi is the period of task  ei is execution time of the task  Di is the relative deadline of task
  • 5.  Example : Ti=(1,10,3,6)  Phase is 1, period is 10, execution time is 3 and relative deadline is 6  First job is released and ready at time 1  Must be completed by time 7  Second job is ready at 11  Must be completed by 17 and so on
  • 6.  Default value of phase is 0  Ti=(10,3,6)  Phase is 0  Period is 10  Execution time is 3  Relative Deadline is 6  Default value of relative deadline is the period of the task  Ti=(10,3)  Phase is 0  Period is 10  Execution time is 3  Relative Deadline is 10
  • 7. Static , Timer-Driven Scheduler  When all the parameters of the job are known, the static schedules of the job can be developed offline  Processor time allocated to the job is its maximum execution time  Scheduler dispatches the jobs according to the static schedule, repeating the jobs at each hyper-period  Static schedules guarantee that each job completes by its deadline
  • 8.  Let us consider four independent periodic task T1=(4,1), T2=(5,1.8), T3=(20,1) and T4=(20,2)  Their utilization are 0.25, 0.36, 0.05 and 0.1 respectively and total utilization is 0.76  Since LCM of periods is 20, hyper period is 20  Entire schedule consists of replicated segments of length 20
  • 9.  Some periods are not used by the task.  These can be used by aperiodic jobs and background non-relative jobs  Static cyclic schedules can be implemented by using algorithm  The algorithm stores the pre-computed schedule as a table  For given task table has 17 entries as shown below:
  • 10. K Tk T(tk) 0 0.0 T1 1 1.0 T3 2 2.0 T2 3 3.8 I 4 4.0 T1 5 5.0 I 6 6.0 T4 7 8.0 T2 8 9.8 T1 9 10.8 I 10 12 T2 11 13.8 T1 12 14.8 I 13 16.0 T1 14 17.0 I 15 18.0 T2 16 19.8 I
  • 11.  Table has 17 entries  tk is decision time  T(tk) is the task to be executed or idle interval(I)  During initialization system creates all the task to be executed  At every decision time scheduler decide T(tk) and sets timer to interrupt at next decision time  It then suspend itself and allow the processor to execute the task
  • 12. General Structure of Cyclic Schedulers  Arbitrary cyclic schedules are flexible but inefficient.  They depend on accurate time interrupt and high scheduling overloads  So clock driven approach is implemented using structural approach rather than tabular approach  Scheduling decision time partition time line into intervals called frames  Scheduling decision are made at the beginning of every frame.  There is no preemption within each frame.
  • 13.  First job of every task is released at the beginning of the frame.  The phase of each periodic task is non-negative integer multiple of frame size  фi=k.f  Gives two benefits  Scheduler can easily check for overrun and missed deadline at the end of each frame  Can use periodic clock interrupt rather than programmable timer.
  • 15. Frame Size Constraints  To avoid preemption, the frame size should be long enough so that every job start and complete within single frame. f ≥ max(e1,e2………en)  Hyper period should be an integer multiple of the frame size to minimize the entries.  There should be at least one frame between release and deadline of the job so that scheduler can check if the job has been completed by its deadline
  • 16.  Example: Consider T1=(4,1.0) , T2=(5,1.8) , T3=(20,1.0) and T4=(20,2.0)  Solution:  H=LCM of 4,5,20 and 20=20  Max of 1.0, 1.8, 1.0 and 2.0 is 2.0 i) f≥2 ii) f is either (2,4,5,10,20) iii) 2f-gcd(Pi,f)≤Di
  • 17.  For f=2  For T1 Pi=4 and Di=4 2*2-gcd(4,2)≤4 4-2≤4 2≤4 (TRUE)  Third condition is satisfied by all the task  F0r f=4,5,10 and 20  Third condition is not satisfied by all the task  Hence the required frame size is 2
  • 18. Job Slices  Consider three independent tasks T1(4,1), T2(5,2,7) and T3(20,5)  f ≥ 5  Since H is 20, f is either 2,4,5,10,20  2f- gcd(Pi,f) ≤4 ≤7 ≤20 All the three conditions are not satisfied.
  • 19.  From above example we see that sometime all the three condition are not satisfied by the task.  In such case job with the largest execution time is sliced into sub-jobs with shorter execution time.  Since period of T1 is 4, all five frames are used by it while T2 uses only 4 frames.  So in above example we divide T3(20,5) into chain of three slices as (20,1) , (20,3) and (20,1)
  • 20.  To construct the cyclic schedule we need to make three design constraints  Choose the frame size based on frame constraints  Slice the jobs  Places the slices in frames  These decision cannot be taken independently  Ideally we want as few slices as possible, but forced to generate more slices in order to get the feasible schedule.
  • 22. Improving Average Response of Aperiodic Jobs  Aperiodic job is released and executed in response to an event.  Sooner the job is completed more responsive the system is.  So minimizing the response time of each aperiodic jobs and average response of all aperiodic jobs is one of design goals.  There is no advantage in giving priority to aperiodic jobs and no advantage in completing the job with hard deadline early.
  • 25.  Figure (a) shows the first major cycle in the cyclic schedule of the periodic tasks  Figure (b) shows three aperiodic jobs A1, A2 and A3  Figure (c) shows when the aperiodic jobs executed when if we use cyclic executive  Figure (d) shows slack stealing
  • 26.  Before Slack Stealing response time of:  A1 is 6.5  A2 is 1.5  A3 is 5.5  After slack stealing response time of:  A1 is 4.5  A2 is 0.5  A3 is 2.5
  • 28. EDF Scheduling of Accepted jobs  EDF algorithm is a good way to schedule the sporadic jobs.  Scheduler maintains the queue of accepted sporadic jobs in increasing order of their deadlines.  It inserts all the newly accepted sporadic in the queue in the same order.  Below is the example using frame size 4.
  • 30. Practical Consideration and Generalization  The practical problem faced in clock-driven system mainly fall into three categories  How to handle frame overrun?  How to do mode change?  How to schedule task in multiprocessor system?
  • 31. Handling Frame Overrun  The frame overrun can occur due to:  Input data dependency  Hardware failure  Software flaws  Frame overrun can be avoided by:  Killing the job that is overrun and starting an error recovery task  Preempting the job and scheduling the remaining job as the aperiodic job  Continue to execute the offending job. The start of the next frame and the execution of jobs in next frame are delayed.
  • 32. Mode Changes  The number of jobs are fixed in particular mode.  Whenever the mode changes the new jobs may be added or old may be deleted. So new table must be brought into memory along with the code of the task.  Mode change job is released in response to the mode change command.  We assume that periodic tasks are independent and hence can be added and deleted independently.
  • 33. Aperiodic Mode Change  A way to schedule the mode change job is to treat it like the ordinary aperiodic job.  Except that it may be given highest priority and executed ahead of other aperiodic jobs.  Once the job execute it begin to modify the old schedule in order to speed up the mode change.  Periodic task that will not be executed in new mode is deleted and its memory space and processor time is freed as soon as current job in the task completes.
  • 34. Sporadic Mode Change  Sporadic job has to be completed by its deadline.  There are two possible way to schedule:  We can treat it like any ordinary sporadic jobs and schedule it.  If the job is not schedulable it can be rejected or the mode change job can be postponed
  • 35. General Workloads and Multiprocessor Scheduling  As long as all the parameters of the jobs are known priori, a static schedule can be computed offline.  It is then stored in tabular form.  Now global schedule can be constructed which specify on which processor job executes and when.  It is more complex to implement.
  • 37. Algorithm for Constructing Static Schedules  Iterative Network Flow(INF) Algorithm is used to find out the feasible cyclic schedule if one exist.  It assumes that task can be preempeted at any time and are independent.  In order to apply the INF we first have to find out the frame size of the system.  Consider three independent tasks T1(4,1), T2(5,2,7) and T3(20,5)  Frame size possible are 2 and 4 which still does not satisfy the first requirement.
  • 38.  INF tries to find the feasible cyclic schedule for possible frame size starting from the largest one.  If the algorithm fails to find one , then we can say that no feasible schedule exist even when the job is divided into sub-jobs.  The major component of INF is network flow graph  The constraints on which jobs can be scheduled are represented by network flow graph.  It contains following vertices and edges:
  • 40.  A flow of an edge is a non-negative number satisfying the following conditions:  It is not greater than the capacity of the edge.  With the exception of source and sink , the sum of the flows of all the edges into every vertex is equal to the sum of flows of all the edges out of the vertex
  • 42.  Consider three independent tasks T1(4,1), T2(5,2,7) and T3(20,5)  Frame size possible are 2 and 4 which still does not satisfy the first requirement.  We use INF to find the feasible algorithm.  We draw the network flow graph for frame size 4.