Reputation: 69
Every system has IDLE task which will be running if no other tasks are ready to run.So my question is , can IDLE task sleep?. My understanding is if idle task sleep then there is a chance of no task is available for the cpu to run. Is my understanding correct? Can anyone provide some link which elaborate about this topic?
Upvotes: 2
Views: 873
Reputation: 24907
It could busy-loop at lowest priority, or loop around code that sets a low-power mode, or a loop around a 'halt' instruction that stops the core execution completely.
Sleep() is not approriate - the CPU has to enter a mode where it is unavailable to any other thread until an interrupt, and Sleep() does not perform that function.
Whatever the hardware supports.
As long as the CPU is able to respond to interrupt requests, any of the above would be fine.
Upvotes: 2