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:Jump to 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.
7 Replies
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.
are these periodic tasks?
Hmm, EDF 🤔 thanks @Joseph Ogbonna
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
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.
Nice thanks