Re: Should idle thread be invoked before main?

Andy Ross

In a technical sense yes: on a SMP system the extra CPUs will likely reach idle (each has its own idle thread obviously) before system initialization is complete and the application main() function is entered.  But that's not your platform.

Absent that, it's not architecturally possible: the main thread (which will eventually enter the main() function) is the first thread created and switched into during system initialization, by construction.  Idle can only run once it blocks.

So if I had to guess, you have a initialization function for some driver or subsystem doing a sleep.  That's not not illegal, but it's kind of weird and we should fix that if it's in-tree.


Join to automatically receive all group messages.