OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
qTask_t Struct Reference

A task node object. More...

#include <qtasks.h>

Detailed Description

A task node object.

Like many operating systems, the basic unit of work is the task. Tasks can perform certain functions, which could require periodic or one-time execution, update of specific variables or waiting for specific events. Tasks also could be controlling specific hardware or be triggered by hardware interrupts. In the QuarkTS OS, a task is seen as a node concept that links together:

  • Program code performing specific task activities (callback function)
  • Execution interval (time)
  • Number of execution (iterations)
  • Event-based data

The OS uses a Task Control Block(TCB) to represent each task, storing essential information about task management and execution. Part of this information also includes link-pointers that allows it to be part of one of the lists available in the Kernel Control Block (KCB).

Each task performs its activities via a callback function and each of them is responsible for supporting cooperative multitasking by being “good neighbors”, i.e., running their callback methods quickly in a non-blocking way and releasing control back to the scheduler as soon as possible (returning). Every task node, must be defined using the qTask_t data-type and the callback is defined as a function that returns void and takes a qEvent_t data structure as its only parameter (This input argument can be used later to get event information.

Example :

qTask_t UserTask;
void UserTask_Callback( qEvent_t e ) {
}
The task argument with all the regarding information of the task execution.
Definition qtasks.h:162
A task node object.
Definition qtasks.h:268
Attention
All tasks in QuarkTS must ensure their completion to return the CPU control back to the scheduler, otherwise, the scheduler will hold the execution-state for that task, preventing the activation of other tasks.
Note
Do not access any member of this structure directly.