A cyclic executive is a simple scheduling architecture used in real-time embedded systems where the central processing unit (CPU) executes a predetermined, fixed sequence of tasks repeatedly in a continuous loop. It is a form of static scheduling that does not require a real-time operating system (RTOS) kernel.
Structure The schedule is divided into a major cycle (or major frame), which represents the total period after which the entire task sequence repeats. The major cycle is subdivided into minor cycles (or minor frames), often triggered by a periodic timer interrupt (the "system tick").
Tasks are assigned to specific minor cycles based on their required execution frequency (rate). For example, a task requiring a 10 Hz update rate runs once per major cycle in a 10 Hz system, while a 20 Hz task runs in two specific minor cycles within the same major cycle.
Characteristics
- Determinism: The execution order and timing are fixed at compile time, providing high predictability.
- Low Overhead: No context switching, scheduler logic, or inter-task synchronization primitives (semaphores, mutexes) are required during runtime, minimizing CPU and memory overhead.
- Simplicity: Implementation typically consists of a main loop calling functions in a specific order, making verification and certification (e.g., DO-178C Level A) straightforward.
- No Preemption: Tasks run to completion. A task cannot be interrupted by a higher-priority task (though hardware interrupts are usually still serviced).
Constraints and Limitations
- Brittleness: Adding a new task or changing a task's period often requires redesigning the entire schedule (re-slotting minor cycles) to ensure all deadlines are met.
- Resource Utilization: The CPU may be idle during minor cycles if assigned tasks finish early or have no work, unless background (aperiodic) work is polled in spare slots.
- Blocking: Long-running tasks can cause deadline misses for subsequent tasks in the same minor cycle or later minor cycles if they overrun their allocated time budget.
- Scalability: Managing the schedule becomes complex as the number of tasks and rate harmonicity decreases (e.g., mixing 7 Hz and 13 Hz tasks requires a major cycle of 91 minor cycles).
Typical Applications Cyclic executives are commonly found in safety-critical, resource-constrained systems where the task set is small, static, and well-understood, such as:
- Avionics control panels and display systems.
- Automotive engine control units (ECUs) for basic functions.
- Industrial programmable logic controllers (PLCs).
- Satellite and spacecraft command and data handling systems.