Any tips for optimizing Round-Robin scheduling in FreeRTOS for real-time applications?

Hey guys, please I need your help here . I'm working on a home automation system using FreeRTOS and experimenting with Round-Robin scheduling for fair task execution. I'm facing issues with critical tasks like sensor data processing and actuator control getting delayed, affecting system responsiveness. I've tried adjusting priorities and time quantum, but the performance isn't as expected. Any tips for optimizing Round-Robin scheduling in FreeRTOS for real-time applications, or suggestions for alternative algorithms that might work better?
Solution:
cool. I think you should assume all the tasks to be periodic and come up the CPU utilisation factor. If that is within 70%, the tasks can be scheduled and no deadline will be missed. If u see that the utilisation is more than 70%, then u need a CPU thats faster or u need to optimise the code to be faster.
Jump to solution
7 Replies
Joseph Ogbonna
Joseph Ogbonna•9mo ago
Consider using a different scheduling algorithm like Earliest Deadline First (EDF) or Rate Monotonic (RM) for better real-time performance in your home automation system. These algorithms are often more suitable for meeting timing requirements compared to Round-Robin scheduling in FreeRTOS.
streetdogg
streetdogg•9mo ago
are these periodic tasks?
Marvee Amasi
Marvee Amasi•9mo ago
Hmm, EDF 🤔 thanks @Joseph Ogbonna
Marvee Amasi
Marvee Amasi•9mo ago
Yes, some of the tasks are periodic, such as sensor data sampling and actuator control updates. However, I'm also dealing with non-periodic tasks like user interface responsiveness and event handling.
Solution
streetdogg
streetdogg•9mo ago
cool. I think you should assume all the tasks to be periodic and come up the CPU utilisation factor. If that is within 70%, the tasks can be scheduled and no deadline will be missed. If u see that the utilisation is more than 70%, then u need a CPU thats faster or u need to optimise the code to be faster.
Marvee Amasi
Marvee Amasi•9mo ago
Nice thanks
Want results from more Discord servers?
Add your server