Cyclic Executive
Cyclic Executive is an alternative to real-time operating systems . It is a form of cooperative multitasking in which only one task is running. The single task is typically written as an infinite loop , e.g. B. in the programming language C in the main method.
Overview
Periodic processes are important software components in real-time computer systems. A periodic process consists of an action, such as a calculation, that is performed repeatedly in a periodic pattern.
A cyclic executive is a control structure or a program to explicitly nest the execution of several periodic processes on a single CPU. The nesting is done in a deterministic way so that the execution time is predictable. It can be seen as an implementation technique for a design methodology in which a real-time system mainly consists of a collection of periodic processes. The Prozessverschachtelung (s: process interleaving ) is (s: after a "cyclic schedule," cyclic schedule ) defined.
advantages
- Easy implementation
- Little effort
- Easy to plan
disadvantage
- No sporadic events treatable
- Everything has to work in step
- Code must be planned manually
example
The basic scheme circulates through a repetitive sequence of tasks on one frequency. An example is an embedded system that monitors a temperature sensor and updates an LCD . If the LCD should be updated ten times per second (every 100 milliseconds) and the temperature sensor for some other reason every 50 milliseconds, a loop could be constructed as follows:
int main(void) { // initialization code here while (1) { currTemp = tempRead(); lcdWrite(currTemp); // waste CPU cycles until 50 ms currTemp = tempRead(); // do other stuff // waste CPU cycles until 100 ms } }
The outer 100 millisecond cycle is defined as the major cycle . In this case there is also an inner minor cycle of 50 milliseconds.
See also
- Arduino Platform - A well-known example of using this technique
- Preemptive multitasking
- Real-time operating system
Web links
Individual evidence
- ↑ The Cyclic Executive Model and Ada (PDF; 1.3 MB)