X hits on this document

52 views

0 shares

0 downloads

0 comments

10 / 20

R8C Family General RTOS Concepts

2.6.2

Task Management

Task management allows programmers to design their software as a number of separate “chunks” of codes with each handling a distinct goal and deadline. This service encompasses mechanism such as scheduler and dispatcher that creates and maintain task objects.

Task Object

To achieve concurrency in real-time application program, the application is decompose into small, schedulable, and sequential program units known as “Task”. In real-time context, task is the basic unit of execution and is governed by three time-critical properties; release time, deadline and execution time. Release time refers to the point in time from which the task can be executed. Deadline is the point in time by which the task must complete. Execution time denotes the time the task takes to execute.

A task object is defined by the following set of components:

  • Task Control block (Task data structures residing in RAM and only accessible by RTOS)

  • Task Stack (Data defined in program residing in RAM and accessible by stack pointer)

  • Task Routine (Program code residing in ROM)

Figure 8 Typical Task Control Block (TCB)

Each task may exist in any of the four states, including running, ready, or blocked and dormant as shown in Figure 9. During the execution of an application program, individual tasks are continuously changing from one state to another. However, only one task is in the running mode (i.e. given CPU control) at any point of the execution. In the process where CPU control is change from one task to another, context of the to-be-suspended task will be saved while context of the to-be-executed task will be retrieved. This process of saving the context of a task being suspended and restoring the context of a task being resumed is called context switching.

Figure 9 Possible States Transition of Tasks

RES05B0008-0100/Rev.1.00

January 2010

Page 8 of 18

Document info
Document views52
Page views52
Page last viewedFri Dec 09 09:56:20 UTC 2016
Pages20
Paragraphs395
Words6183

Comments