Книга: Real-Time Concepts for Embedded Systems

5.5.1 Run-to-Completion Tasks

5.5.1 Run-to-Completion Tasks

An example of a run-to-completion task is the application-level initialization task, shown in Listing 5.1. The initialization task initializes the application and creates additional services, tasks, and needed kernel objects.

Listing 5.1: Pseudo code for a run-to-completion task.

 RunToCompletionTask () {
 Initialize application
 Create ‘endless loop tasks'
 Create kernel objects
 Delete or suspend this task
}

The application initialization task typically has a higher priority than the application tasks it creates so that its initialization work is not preempted. In the simplest case, the other tasks are one or more lower priority endless-loop tasks. The application initialization task is written so that it suspends or deletes itself after it completes its work so the newly created tasks can run.

Оглавление книги

Оглавление статьи/книги

Генерация: 0.078. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз