All threads are scheduled according to their priorities. |
The priority range is between 0 and 31, where 31 is the highest priority. |
Each priority has its queue of ready threads, which can be empty (no threads of this priority ready to run). |
The TCE scheduler always chooses the highest priority thread to run. |
If there is more than one thread, in the highest priority queue, these threads are scheduled in the round-robin fashion. |
When all threads are blocked -- meaning there is no thread ready to be executed, TCE starts its "Idle" thread. That thread just waits for an external even (such as a message or an OS signal). If that even causes one or more of the blocked threads to become ready, the "Idle" thread is stopped and the scheduler selects the ready thread with the highest priority. |