A cyclic executive
is an alternative to a
real-time operating system
A real-time operating system (RTOS) is an operating system (OS) for real-time computing applications that processes data and events that have critically defined time constraints. A RTOS is distinct from a time-sharing operating system, such as Unix ...
. It is a form of
cooperative multitasking
Cooperative multitasking, also known as non-preemptive multitasking, is a computer multitasking technique in which the operating system never initiates a context switch from a running Process (computing), process to another process. Instead, in o ...
, in which there is only one
task. The sole task is typically realized as an infinite loop in , e.g. in
C.
The basic scheme is to cycle through a repeating sequence of activities, at a set frequency ( time-triggered cyclic executive). For example, consider the example of an
embedded system
An embedded system is a specialized computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is e ...
designed to monitor a
temperature sensor and update an
LCD
A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated optical device that uses the light-modulating properties of liquid crystals combined with polarizers to display information. Liquid crystals do not em ...
display. The LCD may need to be written twenty times a second (i.e., every 50 ms). If the temperature sensor must be read every 100 ms for other reasons, we might construct a loop of the following appearance:
int main(void)
The outer 100 ms cycle is called the major cycle. In this case, there is also an inner minor cycle of 50 ms. In this first example the outer versus inner cycles aren't obvious. We can use a counting mechanism to clarify the major and minor cycles.
int main(void)
See also
*
Arduino
Arduino () is an Italian open-source hardware and open-source software, software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its hardwar ...
- a popular example of this paradigm
*
Event loop
In computer science, the event loop (also known as message dispatcher, message loop, message pump, or run loop) is a programming construct or design pattern that waits for and dispatches events or messages in a program. The event loop works by m ...
*
Preemption (computing)
In computing, preemption is the act performed by an external scheduler — without assistance or cooperation from the task — of temporarily interrupting an executing task, with the intention of resuming it at a later time. This preemptive s ...
References
{{Reflist, colwidth=30em
Operating system technology
Concurrent computing