The Active Object model of computation requires the provision of an "execution context" only during the RTC (Run-to-Completion) processing. An Active Object that is merely waiting for event(s) does not need an "execution context" at all. This opens up possibility of executing Active Objects sequentially in a single thread (e.g., the main()
function in C or C++).
QV is a simple cooperative, non-preemptive kernel that executes Active Objects to completion one RTC step at a time. After every RTC step, the QV kernel performs priority-based scheduling that selects the highest-priority Active Object that has an event to process. Due to naturally short RTC steps, the simple non-preemptive QV kernel is often adequate for many real-time systems.
Please note that because the state machines always return to the QV scheduler after each RTC step, a single stack can be used to process all state machines (memory-friendly architecture).
The QV scheduler can also very easily detect when all event queues are empty, at which point it can call the idle callback to let the application put the CPU and peripherals to a low-power sleep mode (power-friendly architecture).
Given the simplicity, portability, and low-resource consumption, the QV scheduler is very attractive. It allows allows the developer to partition the problem into Active Objects and let these Active Objects cooperate to gain access to the CPU. The thread-level response of the QV scheduler is the longest RTC step in the whole system, but because event-driven active objects don't block, the RTC steps tend to be short (typically just a few microseconds). Also, often you can break up longer RTC steps into shorter pieces (multi-stage processing), by posting an event to self and returning ("Reminder" state pattern). The self-posted event then triggers the continuation of longer processing.
REQ-QP-07_00 |
---|
QP Framework shall... |
Description TBD... |