0% found this document useful (0 votes)
419 views19 pages

4 Earliest Deadline First (EDF) Scheduling

This document discusses real-time task scheduling algorithms including Earliest Deadline First (EDF), Rate Monotonic Algorithm (RMA), Priority Inheritance Protocol (PIP), and Priority Ceiling Protocol (PCP). EDF schedules the task with the earliest deadline next, while RMA assigns priorities inversely proportional to task periods. PIP and PCP address priority inversion issues when shared resources are involved. The document provides examples and discusses applicability and limitations of these algorithms.

Uploaded by

4132lenin6497ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
419 views19 pages

4 Earliest Deadline First (EDF) Scheduling

This document discusses real-time task scheduling algorithms including Earliest Deadline First (EDF), Rate Monotonic Algorithm (RMA), Priority Inheritance Protocol (PIP), and Priority Ceiling Protocol (PCP). EDF schedules the task with the earliest deadline next, while RMA assigns priorities inversely proportional to task periods. PIP and PCP address priority inversion issues when shared resources are involved. The document provides examples and discusses applicability and limitations of these algorithms.

Uploaded by

4132lenin6497ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

REAL-TIME SYSTEMS -

U20ECE825

UNIT - I
Earliest Deadline First
(EDF) Scheduling

• small application
• clock – driven
• table-driven
Earliest Deadline First (EDF)
Scheduling
• EDF scheduling is a type of task scheduling algorithm that
schedules (Optimize) the task with the earliest deadline next.
• EDF scheduling is very efficient, but it can be difficult to
implement.
• Dynamic priority scheduling algorithm.

• Assign the highest priority to the task with the earliest deadline.
• Can schedule both periodic and aperiodic tasks.
• Guarantees schedulable if total CPU utilization is less than
100%.
• Complex to implement, high overhead.
Shared Resources
Shared Resources
 Critical section
– Program section where a shared resource is accessed
– No other task can access this resource: Mutual exclusion

 Priority inversion
– A situation in which a higher priority job is blocked by
lower priority jobs for an indefinite time
Priority Inversion Protocol
Two solutions to the priority
inversion problem

– PIP (Priority Inheritance Protocol)


– PCP (Priority Ceiling Protocol)
PIP (Priority Inheritance Protocol)

• If a task execution in a critical section blocks one or more


higher priority tasks, then it temporarily inherits the highest
priority of the blocked tasks
• When a task exits the critical section, it resumes the original
priority it had when it entered that critical section
Example of PIP
PCP (Priority Ceiling Protocol)
– Solution for chained blocking
– If a task execution in a critical section blocks, then it
temporarily inherits the priority ceiling
– The priority ceiling is equal to the highest priority of the
tasks that concurrently hold or will hold that resource
(Lookahead)
– ‘Ceiling’ may be misleading
When PCP is applied
Rate Monotonic Algorithm
(RMA)
Rate Monotonic Algorithm
(RMA)
• Idea of RM algorithm
• A lower-priority task is executing, and a higher-priority task
becomes available to execute, it will preempt the lower-priority task
• Static scheduling
• Shorter period tasks get higher priority
Cont.
• RMA is a type of task scheduling algorithm that schedules
periodic tasks based on their priority.
• RMA is a very efficient scheduling algorithm, but it is only
suitable for systems with a small number of tasks.
• A static priority scheduling algorithm based on task periods.
• Assigns priorities inversely proportional to task periods (shorter
period, higher priority).
• Simpler to implement than EDF, suitable for fixed sets of periodic
tasks.
• Cannot guarantee schedulable for all task sets.
Example of RM Scheduling
Computation
Tasks Deadline (ms)
Time (ms)
10/30+10/55+5/60
S1 D1 = 30 C1 = 10
S2 D2 = 55 C2 = 10
Preemption
S3 D3 = 60 C3 = 5
S2 S1
activation deadline deadline
Priority : S1 > S2 > S3
S1 time
5 15 25 35 45 55 65 75 85

activation deadline

S2 time
5 15 25 35 45 55 65 75 85

deadline
activation

S3 time
5 15 25 35 45 55 65 75 85
Rate Monotonic Scheduling Algorithm

-Schedulability Analysis ( )
• A set of n periodic tasks is schedulable by the RM algorithm if
, where and

• meaning that any task set can be scheduled by RM if p , but


not all task sets can be scheduled if p
Ex) 10/30+10/55+5/60
Issues in RMA

Several issues can arise when using RMA, including:


• Priority inversion: Lower priority tasks can block higher
priority tasks, potentially missing deadlines.
• Deadline misses: Deadline misses occur when a task is not
completed within its deadline.
• Overrun: Task execution time exceeds allocated
time, potentially affecting other tasks.
• Limited applicability: Only suitable for specific task sets
with specific characteristics.
Conclusion
• Real-time systems are a complex and challenging
topic. Real-time systems require careful task
scheduling to meet deadlines and ensure
correctness.
• Different scheduling algorithms have different
strengths and weaknesses, suitable for different
types of tasks and systems.
• Understanding the basics and the characteristics of
real-time systems, you can be better prepared to
design and implement effective real-time systems.
thank you

You might also like