Types of Tasks in Novos Environments
An embedded system is one in which one or more program tasks execute in some order to perform the work of the application. Each one is designed and coded to take care of a particular aspect of the application.
How many tasks are required depends on the application and its requirements, especially the requirements that deal with time and deadlines. There are several types of tasks, each of which has a particular nature when it comes to its temporal performance.
It should be noted that it is rare that an embedded system consists of only a single type of task. More often than not, an application is a mixture of all types.
The major classifications of tasks are:
Run-to-Completion Tasks (RTC)
This is the simplest form of a task. Once it gets control of the processor, it runs until it completes. It cannot pause its execution to wait for some event before it can continue its execution burst. RTC tasks can be found in all Novos environments. Any RTC task has a defined priority and its execution burst may be pre-empted by higher priority RTC task as well as device interrupts. Execution of an RTC task is generally the result of the occurrence of an event although some Novos environments allow direct scheduling of an RTC task. Thus, it s the model used for Deferred Interrupt Handlers (DIH) and Event Action Routines (EAR) in all five Novos environments and for Foreground tasks in the all Novos environments except the Novos Foreground/Background (Novos FB) framework.
A periodic task is one whose arrival time occurs at a pre-determined frequency. In the Novos world, some periodic tasks use an RTC model and some do not. Typically, periodic tasks execute critical control activities and may have hard timing requirements but that is not always the case. Examples include hard real-time sensor-based data acquisition, where accuracy of the data acquisition is needed to minimize signal aliasing. Other examples include system monitoring and low-level servo-based control loops. Periodic Foreground tasks can be used in all Novos environments except Novos FB. In addition, all Novos multitasking environments, Novos FCFS, Novos RRS and Novos PPS, permit periodic scheduling of Background tasks.
An aperiodic task is not periodic and its arrival time is unknown. It is usually event-driven based on the occurrence of a random event, hence the “aperiodic” adjective. Normally, there is a separation time between consecutive arrivals but two or more instances of a task can occur at the same time, giving a separation of 0. Because arrival times between consecutive instances are not predictable the deadline is either an average or some statistical expression.
Aperiodic tasks can have hard, soft or firm real-time requirements depending on the specific application. Because an aperiodic task can arrive even before its estimated separation time, there is no guarantee that it will meet its deadline. And a missed deadline by one task can cascade to other tasks causing them to miss their deadlines as well. Thus, aperiodic tasks are usually defined to be soft real-time tasks.
Aperiodic Foreground tasks are permissible in all Novos environments except for Novos FB. However, care should be taken to ensure their operation does not result in interference that is detrimental to other Foreground tasks that run periodically. Aperiodic Background tasks are permissible in the Novos multitasking environments but would most likely be used in Novos First Come, First Served (Novos FCFS) or Novos Pre-emptive Priority) Novos PPS environments
Simple examples of aperiodic tasks are those that handle interactive operator requests such as keyboard presses, mouse movements, etc.
A sporadic task is essentially an aperiodic task with a worst case (i.e., minimum) arrival time. Any guarantee of performance must be given by the developer so that its Worst Case Execution Time (WCET) will be less than the minimum arrival time. It is difficult to make that calculation a priori because the WCET must also include the interference from interrupts and higher priority tasks that could take precedence.
Sporadic tasks are useful for handling randomly occurring events whose performance can be moderately to highly critical. For example, a pressure spike in a closed PVC reactor vessel could lead to damage to the vessel or even injury to humans. Because such an event is unpredictable and the response to the pressure spike is highly critical, it is best handled by a sporadic task.
A Sporadic task would most likely be used as a Background task in the Novos PPS environment where its assigned priority determines when it will respond to the triggering event.
On the other hand, servicing an I/O device triggers its associated Deferred Interrupt Handler, which may be considered a sporadic Foreground task if it handles an interrupt whose occurrence is unpredictable.