You are on page 1of 4

Real Time Systems

Graded Assignment #1
Ekansh Garg(2020HS11509)
Title: Earliest Deadline First Algorithm (EDF)

Problem:
Implement Earliest Deadline First Algorithm (EDF)

Algorithm Details:
Earliest Deadline First (EDF) is a dynamic priority scheduling algorithm which is used in Real time Systems.
EDF is an optimal scheduling algorithm on pre-emptive uniprocessors.

EDF schedules independent jobs, each characterized by an arrival time, an execution requirement and a
deadline, in a way that all the jobs complete by their deadline.

Example:
Consider following example of 3 processes:

Executio Deadlin
Process Release Period n e
P1 0 4 1 4
P2 0 6 2 6
P3 0 8 3 8

Util Factor = 1/4 +2/6 +3/8 = 0.25 + 0.333 +0.375 = 0.95 = 95%
Util Factor is less than 100%. It is EDF Schedulable.

Execution of EDF:
Code Details:

Following code snippet calculates processor Utilisation Factor.


If utilisation factor is more than 100% then the processes are not EDF schedulable.

Following code calculates the index of process which has minimum deadline:

Following code calculates the Hyper Period:

Following code calculates the next deadline and keeps track of process execution:
Code Output of EDF Schedulable Processes:

Code Output of Not EDF Schedulable Processes:


Consider following processes to be scheduled:

Executio Deadlin
Process Release Period n e
P1 0 5 3 5
P2 0 7 3 7
P3 0 25 8 25

Util Factor = 135%

You might also like