Preemptive Non-Blocking Kernel. More...
|QK/C (preemptive non-blocking kernel) platform-independent public interface. |
|QP/C public interface including backwards-compatibility layer. |
|QK preemptive kernel core functions. |
|QMutex_init(), QMutex_lock and QMutex_unlock() definitions. |
|QF/C port example for QK, generic C compiler. |
|QK/C port example for a generic C compiler. |
Preemptive Non-Blocking Kernel.
QK is a tiny preemptive, priority-based, non-blocking kernel designed specifically for executing active objects. QK runs active objects in the same way as prioritized interrupt controller (such as NVIC in ARM Cortex-M) runs interrupts using the single stack (MSP in Cortex-M). Active objects process their events in run-to-completion fashion and remove themselves from the call stack, the same way as nested interrupts. At the same time high-priority active objects can preempt lower-priority active objects, in the same way as interrupts can preempt each other under a prioritized interrupt controller. QK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis RMA) and can be used in hard real-time systems.
Sometimes it is not practical to break up long RTC steps, and consequently the task-level response of the simple "QV kernel" might be too slow. In this cases you need to use a preemptive kernel. The big advantage of preemptive kernel is that it effectively decouples high-priority task from low-priority tasks in the time domain. The timeliness of execution of high-priority task is almost independent on the low-priority tasks. But of course there is no such thing as a free lunch. Preemptive kernels open the whole new class of problems related to race conditions. So you need to be very careful about sharing any resources.