Scheduler

When a task is preempted, the kernel scheduler is called to select the next task to run. If the previously active task is still eligible to run, then it is appended to the end of the list of runnable tasks that have the same priority as that particular task’s priority (see Task Priorities below).

image

When a task becomes runnable (e.g. a resource that it is waiting on becomes available), the scheduler is called before the next tick interrupt, without waiting for the current task to finish its time-slice. This gives the system a very fast response time to real-time events. Having a tick time shorter than a time-slice (e.g. 10ms vs. 50ms) allows finer granularity for the REXIS sleep API functions such as REXIS_TaskSleepMillisecs.

There is nothing particularly special about 10ms system tick interrupts and a 50ms time-slice. As scheduling and context switching are overhead (i.e. they are kernel code and not user code), they should not be done too frequently. Most RTOSes choose similar values, as these provide reasonable performance.