Professional Documents
Culture Documents
A priority – driven scheduler is an on-line scheduler. It does not pre-compute a schedule of tasks, instead if
assigns priority to jobs after they are released and places the jobs in a ready job queue in priority
When preemption is allowed at any time, a scheduling decision is made whenever a job is released or completes.
At each scheduling decision time, the scheduler update the ready job and then schedules and executes the job a
head of head of the
Priority driven algorithms differ from each other in how priorities are assigned to jobs
o Fixed priority
o Dynamic priority
A fixed priority algorithms assigns the same priorities to all the jobs in each tasks. The priority of each periodic
task is fixed relative to other tasks.
A dynamic priority algorithms assigns different priorities to the individual jobs in each Hence the priority of the
task with respect to that of other tasks changes as jobs are released and completed.
A well-known fixed priority algorithms is the rate monotonic algorithms. The algorithm assigns priorities to task based on
their periods as shorter period have higher priority. The rate (of job release) of a task is inverse of periods that means
higher rate gets higher priority.
For example: consider a system contains three tasks T1 (4, 1), T2 (5, 2) and T3 (20, 5) then Rate for task T1 = ¼
This algorithms assigns priorities to tasks according to their relative deadlines as the shorter deadline gets higher priority.
When the relative deadlines are arbitrary, DM algorithms performs better in the sense that it can sometimes produce the
feasible schedule if RM algorithms fails that means RM algorithms always fails if DM algorithms fails.
According to DM priority be assigned as T2> T3 >T1 The schedule table be constructed as:
The EDF algorithms assigns priorities to individual’s job in the tasks according to their absolute deadlines. EDF
algorithms is a task level dynamic priority algorithm.
T1 (2, 1)
T2 (5, 2.5)
Hyper period (H) = 10
A well-known dynamic priority algorithms is least slack time. It assigns the priorities to individual jobs in the task
according to slack time. If d be the deadline, e be the execution time then at time t slack time be equals to d-e-t.
The scheduler checks the slack of all ready jobs at each time a new job is released and orders the new and existing jobs in
accordance with slack time as smaller slack have the higher priority.
T1 (2, 1)
T2 (5, 2.5)
Two jobs J11 and J21 are released at time 0 then Slack for J11 = 2-1-0=1
Here T1> T2, the job J11 is completely executes in between time 0 and 1 then J21 inters into the execution.
At time 2, new job J12 is released then Slack for J12 = 4-1-2=1
Here T1>T2, the job J12 is preempted and J12 enters into the execution and released at 3. The job J21 resumed for
execution after time 3.
At time 4, new job J13 is released then Slack for J13 = 6-1-4=1
Here T2>T1, the job J21 executes up to 4.5 and J13 enters into execution.
At time 5, new job J22 is released then Slack for J22= 10-2.5-5=2.5
Here T1> T2, the job executes up to 5.5 and job J22 enters into execution.
At time 6, the new job J14 released then Slack for J14 = 8-1-6=1
At time 8, new job J15 is released then Slack for J15 = 10-1-8=1
Here have the equal priority so J15 completes its execution up to 9 and J22 completes its execution up to 10.
In this approach, the priority order is only changed only when the new job is released or any job finishes its execution
such that there is no follow of LST algorithms at any time. This type of priorities is non strict and corresponding
algorithms is called non strict LST algorithms otherwise it is called strict algorithms. In case of strict approach, scheduler
follow the LST rule during the change of slack at any time and updates the job list of queue according to change of
priority.
For example: in above, at time 2.6 Slack time for J12 = 4-0.4-2.6 = 1 Slack time for J21 = 5- 1.5- 2.6 = 0.9
Here J21 gets higher priority than J12. Due to continuous observation and computation of slacks at each period of time,
strict LST algorithms suffers from run-time overhead.
Since, no algorithms can feasibly schedule a set of tasks with a total utilization greater than 1, an algorithms can feasibly
whose schedulable utilization is equal to 1 is an optimal algorithms.
Find the critical instant when the system is most loaded and its worst response
Use time demand analysis to determine if the system is schedulable at that
Critical Instant:
A critical instant for a job is the worst-case release time for that job, taking into account all jobs that have higher priority
i.e. a job released at the same instant as all jobs with higher priority are released, and must wait for all those jobs to
complete before it executes.
A critical instant of a task Ti is a time instant such that:
the job of Ti released at this instant has the maximum response time of all jobs in Ti, if the response time of every
job of Ti is at most Di, the relative deadline of Ti and
the response time of the job released at this instant is greater than Di of the response time of some jobs in Ti
exceeds Di
The schedulability test involves for checking each task as it is scheduable or not in the critical instant. The critical instant
theorem states that, a fixed-priority system where every job completes before the next job of the same task is released, a
critical instant of any task Ti occurs when one of its job Ji,c is released at the same time with a job of every higher priority
task.
For example: Consider three tasks T1 (2, 0.6), T2 (2.5, 0.2), T3 (3, 1.2) Here T1>T2>T3
Response time for Job J22 of task T2 = r22 = 2.8 - 2.5 = 0.3 Response time for Job J23 of task T2 = r23 = 5.2 – 5 = 0.2
Response time for Job J24 of task T2 = r24 = 7.7 -7.5 = 0.2 Response time for Job J25 of task T2 = r25= 0.8
The response time all jobs of task T2 never exceed the response time of first job. Hence the critical instant is equal to t=0
and t=10.
Response time for Job J31 of task T3 = r31 = 2 Response time for Job J32 of task T3 = r32 = 1.8 Response time for Job
J33 of task T3 = r33 = 2 Response time for Job J34 of task T3 = r34 = 2
Here the response time for jobs in T3 never exceed the response time of first job in T3. Hence critical instant of T3 are t=
0, 6 and 9.
The process used to determine whether a task can meet its deadline is called time demand analysis. Methods to time-
demand analysis are:
1. Compute the total demand for processor time by job released at a critical instant of task and by higher priority
task as a function of time from the critical instant.
2. Check weather tis demand can be met before the deadline of job as follows:
-Consider the scanning is done one task at a time from higher priority and working down to lowest priority.
-Focused on a job in Ti where the released at time t0 of that job is a critical instant of Ti.
-At time t0+t for ≥ 0, compute the processor time demand wi (t) of this job and all higher priorities job released in [t0, t]
using
-If ( ) > 0 ≤ ≤ , the task may not complete by its deadline and system cannot scheduled by using fixed priority
algorithms.