<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://www.pic24.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.pic24.ru/feed.php">
        <title>PIC24 en:tnkernel:ref:task</title>
        <description></description>
        <link>http://www.pic24.ru/</link>
        <image rdf:resource="http://www.pic24.ru/lib/images/favicon.ico" />
       <dc:date>2023-02-11T02:03:11+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/tnkernel/ref/task/intro?rev=1216578662"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.pic24.ru/lib/images/favicon.ico">
        <title>PIC24</title>
        <link>http://www.pic24.ru/</link>
        <url>http://www.pic24.ru/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://www.pic24.ru/doku.php/en/tnkernel/ref/task/intro?rev=1216578662">
        <dc:format>text/html</dc:format>
        <dc:date>2008-07-20T22:31:02+03:00</dc:date>
        <title>TNKernel : Tasks</title>
        <link>http://www.pic24.ru/doku.php/en/tnkernel/ref/task/intro?rev=1216578662</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;tnkernel_tasks&quot; id=&quot;tnkernel_tasks&quot;&gt;TNKernel : Tasks&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;TNKernel : Tasks&quot; [1-32] --&gt;
&lt;h2&gt;&lt;a name=&quot;introduction&quot; id=&quot;introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

In TNKernel, a task is a branch of the code that runs concurrently with another tasks from the programmer&amp;#039;s point of view. At the physical level, tasks are actually executed using processor time sharing. 
Each task can be considered to be an independed program, which executes in its own context (processor 
registers, stack pointer, etc.).
&lt;/p&gt;

&lt;p&gt;
When the currently running task loses its claim for executing (by the issuing of a system call or interrupt), a context switch is performed. The current context  (processor registers, stack pointer, etc.) is saved and the context of another task is restored. This mechanism in the TNKernel is called the &amp;quot;dispatcher&amp;quot;. 
&lt;/p&gt;

&lt;p&gt;
Generally, there are more than one executable task, and it is necessary to determine the order of the task switching (execution) by using some rules. &amp;quot;Scheduler&amp;quot; is a mechanism that controls the order of the task 
execution.
&lt;/p&gt;

&lt;p&gt;
TNKernel uses a priority-based scheduling based on a priority level assigned to the each task. The 
smaller the value of the priority, the higher the priority level. TNKernel uses a &lt;strong&gt;16&lt;/strong&gt; levels of priority for PIC24/dsPIC port and 32 levels for original ARM version.
&lt;/p&gt;

&lt;p&gt;
Priorities &lt;strong&gt;0&lt;/strong&gt; (highest) and &lt;strong&gt;15&lt;/strong&gt;(31) (lowest) are reserved by the system for the internal using. The user may create tasks with priorities from &lt;strong&gt;1&lt;/strong&gt; to &lt;strong&gt;14&lt;/strong&gt;(30).
&lt;/p&gt;

&lt;p&gt;
In TNKernel, more than one task can have the same (identical) priority.

&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Introduction&quot; [33-1470] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_states&quot; id=&quot;task_states&quot;&gt;Task States&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

There are four task states in TNKernel:
&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;RUNNING&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;The task is currently executing&lt;/dd&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;READY&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;The task is ready to execute, but cannot do so because a task with higher priority (sometimes same priority) is already executing.  A task may execute at any time once the processor becomes 
available. In TNKernel, both &lt;code&gt;RUNNING&lt;/code&gt; and &lt;code&gt;READY&lt;/code&gt; states are marked as &lt;code&gt;RUNNABLE&lt;/code&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;WAIT/SUSPEND&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;When a task is in the WAIT/SUSPEND state, the task cannot execute because the conditions necessary for its execution have not yet been met and the task is waiting for them. When a task enters the WAIT/SUSPEND state, the task&amp;#039;s context is saved. When the task resumes execution from the WAIT/SUSPEND state, the task&amp;#039;s context is restored. &lt;code&gt;WAIT/SUSPEND&lt;/code&gt; actually have one of three types:
&lt;/p&gt;
&lt;table class = &quot;fpl&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;WAITING&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 The task execution is blocked until some synchronization action occurs, such as timeout expiration, semaphore available, event occurring, etc.		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;SUSPENDED&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 The task is forced to be blocked (switched to the non-executing state) by another task or 
itself		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;WAITING_SUSPENDED&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
  Both WAITING and SUSPENDED states co-exist. In TNKernel, if a task leaves a &lt;code&gt;WAITING&lt;/code&gt; state, but a &lt;code&gt;SUSPENDED&lt;/code&gt; state exists, the task is not switched to the &lt;code&gt;READY/RUNNING&lt;/code&gt; state. Similarly, if a task leaves &lt;code&gt;SUSPENDED&lt;/code&gt; state, but a &lt;code&gt;WAITING&lt;/code&gt; state exists, the task is not switched to the &lt;code&gt;READY/RUNNING&lt;/code&gt; state. A task is switched to &lt;code&gt;READY/RUNNING&lt;/code&gt; state only if there are neither &lt;code&gt;WAITING&lt;/code&gt; nor &lt;code&gt;SUSPENDED&lt;/code&gt; states flagged on it.		&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;DORMANT&lt;/code&gt; &lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;The task has been initialized and it is not yet executing or it has already exited. Newly created tasks always begin in this state.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;&lt;br/&gt;
 
&lt;/p&gt;

&lt;p&gt;
One especial state when the task is not created/initialized yet is &lt;code&gt;NON-EXISTENT&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
The following picture describe the task states switching rules:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/tnkernel/ref/task/tn_task_states_diagram.png?id=en%3Atnkernel%3Aref%3Atask%3Aintro&quot; class=&quot;media&quot; title=&quot;tnkernel:ref:task:tn_task_states_diagram.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/tnkernel/ref/task/tn_task_states_diagram.png&quot; class=&quot;mediacenter&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
The &lt;acronym title=&quot;Application Programming Interface&quot;&gt;API&lt;/acronym&gt; fuctions that prompts for a state switsh is shown near the switch direction. For simply prefix &lt;code&gt;tn_task_&lt;/code&gt; and prefix &lt;code&gt;i&lt;/code&gt; (call from interrupt) is dropped. 
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task States&quot; [1471-3614] --&gt;
&lt;h2&gt;&lt;a name=&quot;scheduling_rules&quot; id=&quot;scheduling_rules&quot;&gt;Scheduling rules&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

In TNKernel, as long as the highest privilege task is running, no other task will execute unless the highest privilege task cannot  execute (for instance, for being placed in the &lt;code&gt;WAITING&lt;/code&gt; state).
&lt;/p&gt;

&lt;p&gt;
Among tasks with &lt;em&gt;different priorities&lt;/em&gt;, the task with the highest priority is the highest privilege task and will execute.
&lt;/p&gt;

&lt;p&gt;
Among tasks of the &lt;em&gt;same priority&lt;/em&gt;, the task that entered into the runnable (&lt;code&gt;RUNNING&lt;/code&gt; or &lt;code&gt;READY&lt;/code&gt;) state first is the highest privilege task and will execute.

&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
 Example: Task A has priority 1, tasks B, C, D, E have priority 3, tasks F,G have  priority 4, task I has priority 5. If all tasks are in the READY state,  this is the sequence of tasks executing :&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;
&lt;br/&gt;
 
&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
 1. Task A - highest priority (priority 1)&lt;br/&gt;
 2. Tasks B, C, D, E  - in order of entering into runnable state for this priority (priority 3)&lt;br/&gt;
 3. Tasks F, G  - in order of entering into runnable state for this priority (priority 4)&lt;br/&gt;
 4. Task I - lowest priority (priority 5)&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;

In TNKernel, tasks with the same priority may be scheduled in round robin fashion by getting  a 
predetermined time slice for each task with this priority. 
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Scheduling rules&quot; [3615-4774] --&gt;
&lt;h2&gt;&lt;a name=&quot;system_tasks&quot; id=&quot;system_tasks&quot;&gt;System Tasks&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

In TNKernel, the task (&lt;code&gt;timer_task&lt;/code&gt;) with priority 0 (highest) is used for supporting the system tick timer functionality and the task (&lt;code&gt;idle_task&lt;/code&gt;) with priority 15(31) (lowest) is used for performing statistics.
&lt;/p&gt;

&lt;p&gt;
TNKernel automatically creates these tasks at the system start.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;System Tasks&quot; [4775-5084] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_control_block&quot; id=&quot;task_control_block&quot;&gt;Task Control Block&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Each task has an associated task control block (TCB), defined as:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; TN_TCB_S_STRUCT
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    TN_UWORD                &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; task_stk;
    CDLL_QUEUE_S              task_queue;
    CDLL_QUEUE_S              timer_queue;
    CDLL_QUEUE_S              block_queue;
    CDLL_QUEUE_S              create_queue;
    CDLL_QUEUE_S              mutex_queue;
    CDLL_QUEUE_S            &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pwait_queue;
    &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; TN_TCB_S_STRUCT  &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; blk_task;
&amp;nbsp;
    TN_UWORD                &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; stk_start;
    TN_UWORD                  stk_size;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;                    &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; task_func_addr;
    &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;                    &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; task_func_param;
&amp;nbsp;
    TN_UWORD                  base_priority;
    TN_UWORD                  priority;
    TN_UWORD                  id_task;
&amp;nbsp;
    TN_WORD                   task_state;
    TN_UWORD                  task_wait_reason;
    TN_WORD                   task_wait_rc;
    TN_UWORD                  tick_count;
    TN_UWORD                  tslice_count;
&amp;nbsp;
    TN_UWORD                  ewait_pattern;
    TN_UWORD                  ewait_mode;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;                    &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; data_elem;
&amp;nbsp;
    TN_UWORD                  activate_count;
    TN_UWORD                  wakeup_count;
    TN_UWORD                  suspend_count;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; TN_TCB_S;&lt;/pre&gt;&lt;table class = &quot;fpl&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_stk&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Pointer to the task&amp;#039;s top of stack		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Queue to include task in the ready/wait lists		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;timer_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Queue to include task in the timer(timeout,etc.) list		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;block_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Queue to include task in the blocked task list only used for mutexes priority ceiling protocol		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;create_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Queue is used to include task in create list only		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;mutex_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 List of all mutexes locked by the tack		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;pwait_queue&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Ptr to the object&amp;#039;s (semaphor,event,etc.) wait list, the task is waiting for		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;blk_task&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Store task  blocking our task (for the mutexes priority ceiling protocol only)		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;stk_start&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Base address of the task&amp;#039;s stack space		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;stk_size&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 The task stack size (in sizeof (void*), not bytes)		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_func_addr&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 The task function pointer		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_func_param&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 The task function parameter pointer		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;base_priority&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Task base priority		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;priority&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Task current priority		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;id_task&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 ID for verification		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_state&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Task state		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_wait_reason&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Reason for the waiting		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;task_wait_rc&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Waiting return code (reason why waiting finished)		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;tick_count&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Remaining time until timeout		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;tslice_count&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Time slice counter		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;ewait_pattern&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Event wait pattern		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;ewait_mode&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Event wait mode: _AND or _OR		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;data_elem&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Location to store data queue entry, if the data queue is full		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;activate_count&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Activation request count		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;wakeup_count&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Wakeup request count		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;code&gt;suspend_count&lt;/code&gt;		&lt;/td&gt;
		&lt;td&gt;
 Suspension count - for statistic		&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

&lt;p&gt;&lt;div class=&quot;notewarning&quot;&gt;
Task Control Block is available only when &lt;code&gt;TN_DEBUG&lt;/code&gt; defined. Nevertheless direct access to Task Control Block is not recommend for the system safety.

&lt;/div&gt;&lt;/p&gt;

&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task Control Block&quot; [5085-8189] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_api&quot; id=&quot;task_api&quot;&gt;Task API&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

TNKernel has the following &lt;acronym title=&quot;Application Programming Interface&quot;&gt;API&lt;/acronym&gt; functions for control tasks:

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Function  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Creata and delete task&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_create&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_create&quot; rel=&quot;nofollow&quot;&gt;tn_task_create()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Create task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_delete&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_delete&quot; rel=&quot;nofollow&quot;&gt;tn_task_delete()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Delete task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Reset task&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_exit&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_exit&quot; rel=&quot;nofollow&quot;&gt;tn_task_exit()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Exit from the current task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_terminate&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_terminate&quot; rel=&quot;nofollow&quot;&gt;tn_task_terminate()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Terminate task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_activate&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_activate&quot; rel=&quot;nofollow&quot;&gt;tn_task_activate()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Activate task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/vtnkernel/ref/task/tn_task_iactivate&quot; class=&quot;wikilink2&quot; title=&quot;vtnkernel:ref:task:tn_task_iactivate&quot; rel=&quot;nofollow&quot;&gt;tn_task_iactivate()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Activate task from interrupt &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Suspend and resume task&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_suspend&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_suspend&quot; rel=&quot;nofollow&quot;&gt;tn_task_suspend()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Suspend task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_isuspend&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_isuspend&quot; rel=&quot;nofollow&quot;&gt;tn_task_isuspend()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Suspend task from interrupt &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_resume&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_resume&quot; rel=&quot;nofollow&quot;&gt;tn_task_resume()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Resume task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_iresume&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_iresume&quot; rel=&quot;nofollow&quot;&gt;tn_task_iresume()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Resume task from interrupt &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Sleep and wakeup task&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_sleep&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_sleep&quot; rel=&quot;nofollow&quot;&gt;tn_task_sleep()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Sleep task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_wakeup&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_wakeup&quot; rel=&quot;nofollow&quot;&gt;tn_task_wakeup()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Wakeup task &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_iwakeup&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_iwakeup&quot; rel=&quot;nofollow&quot;&gt;tn_task_iwakeup()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Wakeup task from interrupt &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Forced release from &lt;code&gt;WAITING&lt;/code&gt;&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_release_wait&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_release_wait&quot; rel=&quot;nofollow&quot;&gt;tn_task_release_wait()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Forced release from &lt;code&gt;WAITING&lt;/code&gt; state &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/vtnkernel/ref/task/tn_task_irelease_wait&quot; class=&quot;wikilink2&quot; title=&quot;vtnkernel:ref:task:tn_task_irelease_wait&quot; rel=&quot;nofollow&quot;&gt;tn_task_irelease_wait()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Forced release from &lt;code&gt;WAITING&lt;/code&gt; state in interrupt &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Change task priority&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row22&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_change_priority&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_change_priority&quot; rel=&quot;nofollow&quot;&gt;tn_task_change_priority()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Change task priority &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row23&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;2&quot;&gt; &lt;strong&gt;Get task reference&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row24&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_reference&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_reference&quot; rel=&quot;nofollow&quot;&gt;tn_task_reference()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Get task reference &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row25&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;   &lt;a href=&quot;http://www.pic24.ru/doku.php/en/tnkernel/ref/task/tn_task_ireference&quot; class=&quot;wikilink2&quot; title=&quot;en:tnkernel:ref:task:tn_task_ireference&quot; rel=&quot;nofollow&quot;&gt;tn_task_ireference()&lt;/a&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Get task reference from interrupt &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task API&quot; [8190-] --&gt;</description>
    </item>
</rdf:RDF>
