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 2: Earliest Deadline First (EDF) Algorithm
#include <stdio.h>#define RED_LIGHT 0#define YELLOW_LIGHT 1#define GREEN_LIGHT 2void task_red_light_edf(int deadline) {printf("Red light ON\n");}void task_yellow_light_edf(int deadline) {printf("Yellow light ON\n");}void task_green_light_edf(int deadline) {printf("Green light ON\n");}void task_scheduler_edf() {// Schedule tasks based on deadline and prioritytask_red_light_edf(10); //deadline 10ms, high prioritytask_yellow_light_edf(5); //deadline 5ms, medium prioritytask_green_light_edf(15); // deadline 15ms, low priority}int main() {task_scheduler_edf();return 0;}
#include <stdio.h>#define RED_LIGHT 0#define YELLOW_LIGHT 1#define GREEN_LIGHT 2void task_red_light_edf(int deadline) {printf("Red light ON\n");}void task_yellow_light_edf(int deadline) {printf("Yellow light ON\n");}void task_green_light_edf(int deadline) {printf("Green light ON\n");}void task_scheduler_edf() {// Schedule tasks based on deadline and prioritytask_red_light_edf(10); //deadline 10ms, high prioritytask_yellow_light_edf(5); //deadline 5ms, medium prioritytask_green_light_edf(15); // deadline 15ms, low priority}int main() {task_scheduler_edf();return 0;}
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
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
E
EdgeBench
EdgeBench is a remote platform that lets developers build, test, and evaluate embedded applications on real hardware through a browser.