High-resolution timekeeping is a desirable feature in real-time operating systems targeting microcontrollers, which traditionally has been held back due to its impact on context switch overhead. In this paper we present the design of a timing subsystem that decouples preemption from the timekeeping operation. This design, making use of 1+N hardware timers, significantly speeds up the context switch code while scaling effectively to multi-core microcontroller architectures with N cores. Preliminary experimental results on the Miosix fluid kernel show the effectiveness of the proposed design.
Terraneo et al. (Thu,) studied this question.