|
Real-time systems require a number of operating system timing services. The operating system must be able to keep an accurate accounting of the passage of time, schedule threads at precise times, and suspend threads for precise intervals.
The RTX clock and timer facilities provide the services necessary for threads to perform periodic tasks that correspond with the external passage of time.
Timers are associated with a clock in the system - against which a timer's expiration is measured - when they are created. A timer begins to count down to its expiration after having been set. Once the timer has expired, the timer can be automatically rearmed. The handling thread is then executed. The execution of the handling routine does not affect the rearming of the timer. Timers that have their repeat interval set to zero execute their handling routine only once and are referred to as "one-shot" timers. Timers that have their repeat interval set to a valid value will execute their handling routine on an ongoing periodic basis and are referred to as "repeat" or "interval" timers.
In addition to clocks and timers, RTX provides sleep services that let you suspend the current thread for a specified period of time.
Topics: