which algo is much memory efficient and has better performance in traffic control system RMS or EDF?
So guys I want to get your opinion on this. I want to implement a task scheduling algorithm to control a traffic light system with three colors: red, yellow, and green. We can use two different algorithms:
Algorithm 1: Rate Monotonic Scheduling (RMS)
Algorithm 2: Earliest Deadline First (EDF) Algorithm
Both algorithm achieves the Same goal but with different approaches. I know I am just printing strings to console , but in a real life scenario which is much memory efficient and has better performance in a traffic control system?
RMS or EDF?
@Middleware & OS
2 Replies
@Marvee Amasi
For a traffic light system,
Earliest Deadline First
is actually a better choice than Rate Monotonic Scheduling
.
Let me tell you why:
1) Traffic light timing is more deadline-driven:
- In traffic lights, ensuring smooth traffic flow relies on lights turning green at specific times (deadlines) to avoid congestion.
- EDF prioritizes tasks with the earliest deadlines, aligning better with this need.
2) RMS prioritizes shorter periods, which might not be ideal:
- RMS prioritizes tasks with shorter periods (execution times) like the yellow light.
- In traffic control, prioritizing a longer green light (allowing more traffic flow) might be more important than a short yellow light.
Well although know that
-EDF requires calculating deadlines for each light cycle, which might be more complex to implement.
In Here's a real-world scenario to consider:
Imagine rush hour traffic. With EDF, the green light has an earlier deadline to ensure smooth flow. If a sensor detects heavy traffic, the deadline for the green light can be adjusted dynamically in EDF, allowing it to stay on longer. This flexibility might be beneficial in a wayThanks @Enthernet Code , so EDF would be much effective for my project .