Unlike many other RTOSes, ChibiOS/RT supports multiple threads at the same priority level and schedules them using an round-robin strategy.
A round-robin rotation can happen because of the following events:
chThdYield()
API in order to allow the execution of another thread at the same priority level, if any.CH_CFG_TIME_QUANTUM
configuration constant is set to a value greater than zero and if the specified time quantum expired and if a thread with equal priority is ready then the currently executing thread is preempted and reinserted in the ready list behind any other thread at the same priority level.
As you can see the CH_CFG_TIME_QUANTUM
setting is really useful only if there are threads at the same priority level that can run not preempted for long periods of time and that do not explicitly yield using chThdYield()
. Because of this you should consider setting CH_CFG_TIME_QUANTUM
to zero in your configuration file, this makes the kernel much faster and smaller and does not forbid the use of multiple threads at the same priority level.
ChibiOS - Copyright © 2006..2017 Giovanni Di Sirio.