2.6 Time Based Scheduling

The real time part of a Real Time Kernel means the kernel is fully aware of the passage of time. In addition, an RTK should also be able to use time to determine which thread to execute. The most basic form of real-time support is to allow a thread be activate at a certain time.

This is useful for operations that only needs to occur at a frequency that is much lower than the timer frequency (in the case of preemptive multithreading) or the natural frequency of cooperative multithreading. For instance, we may only need to perform a self-diagnostic check every minute. The logic of this thread may be as follows:


\begin{algorithmic}
\WHILE{true}
\STATE perform self diagnostics
\STATE sleep for one minute
\ENDWHILE
\end{algorithmic}

The ability to schedule a thread to wake up later saves processing resources because the kernel can compare an internal counter value to the scheduled time very quickly.



Copyright © 2008-10-25 by Tak Auyeung