What happens if there's no idle task in an RTOS?
Good day guys 🙌, Please I really need to know what happens if there's no idle task in an RTOS? Does the system automatically generate one? And besides consuming CPU time, what other roles do idle tasks play?
Solution:Jump to solution
I doubt there is any RTOS that would do that. If there would be no idle task, then the list of runnable tasks would be empty and the scheduler would probably crash. Generally the single most important reason for idle thread's existence is to make the list of runnable tasks "never empty". This simplifies the code of scheduler.
4 Replies
Is there any source to learn RTOS, I want to know more about it
https://www.freertos.org/RTOS-idle-task.html
@Marvee Amasi @aymen ammari
FreeRTOS
RTOS idle task and the FreeRTOS idle task hook function
RTOS idle task and the FreeRTOS idle task hook
Thanks, very resourceful
Solution
I doubt there is any RTOS that would do that. If there would be no idle task, then the list of runnable tasks would be empty and the scheduler would probably crash. Generally the single most important reason for idle thread's existence is to make the list of runnable tasks "never empty". This simplifies the code of scheduler.