Lines Matching refs:task

8 The task module of the OpenHarmony LiteOS-M supports switching between tasks to help users manage b…
12 - A task represents a thread.
25 A task has multiple states. After the system initialization is complete, the created tasks can comp…
27 A task can be in any of the following states:
29 - Ready: The task is in the ready queue, waiting for execution by a CPU.
31 - Running: The task is being executed.
33 - Blocked: The task is not in the ready queue. The task may be suspended, delayed, waiting for a se…
35 - Dead: The task execution is complete and waiting for the system to reclaim resources.
41 ![](figures/task-state-transitions.png "task-state-transitions")
43 …to the sequence of task status transition. There is only one task running at a time. Therefore, th…
45 The task state transition process is as follows:
49 …A task enters Ready state once created. When task switching occurs, the task with the highest prio…
52task is blocked (suspended, delayed, or reading semaphores), it will be inserted to the blocked ta…
55task is recovered (for example, the task is resumed, the delay period or semaphore read period tim…
58 …When a task in the Ready state is blocked (suspended), the task changes to the Blocked state and i…
61task with a higher priority is created or recovered, tasks will be scheduled. The task with the hi…
64task is complete, it changes to the Dead state. The Dead state includes normal exit state as the t…
67 If an API is called to delete a blocked task, the task state change from Blocked to Dead.
71 A task ID is returned when a task is created. The task ID uniquely identifies a task in the system.…
75 Tasks are executed based on their priority. When task switching occurs, the task with the highest p…
79 … to be executed when a task is scheduled. This function is implemented by users and set in the tas…
83 An independent memory space for each task. The stack stores information such as local variables, re…
87task. When a task is suspended, other running tasks might modify the register values of the suspen…
91task has a task control block (TCB). A TCB contains task information, such as context stack pointe…
95 …the task with the highest priority in the Ready queue, saving the context of the switched-out task
100task is created, the system initializes the task stack and presets the context. The system places …
105 The following table describes APIs available for the OpenHarmony LiteOS-M task module. For more det…
107 **Table 1** APIs of the task management module
111task| **LOS_TaskCreateOnly**: creates a task and places the task in the Blocked state.<br>**LOS_Ta…
112task status| **LOS_TaskResume**: resumes a suspended task to place the task in the Ready state.<br…
113task scheduling| **LOS_TaskLock**: locks task scheduling. However, tasks can still be interrupted.…
114task priority| **LOS_CurTaskPriSet**: sets the priority for the current task.<br>**LOS_TaskPriSet*…
115task.<br>**LOS_NextTaskIDGet**: obtains the ID of the task with the highest priority in the Ready …
116 | Updating task information| **LOS_TaskSwitchInfoGet**: obtains the task switching information. The…
120 The typical development process of the task module is as follows:
122 1. Use **LOS_TaskLock** to lock task scheduling and prevent high-priority tasks from being schedule…
124 2. Use **LOS_TaskCreate** to create a task.
126 3. Use **LOS_TaskUnlock** to unlock task scheduling so that tasks can be scheduled by priority.
128 4. Use **LOS_TaskDelay** to delay a task.
130 5. Use **LOS_TaskSuspend** to suspend a task.
132 6. Use **LOS_TaskResume** to resume the suspended task.
137 > - The task name is a pointer without memory space allocated. When setting the task name, do not a…
139 > - The task stack size is 8-byte aligned. Follow the "nothing more and nothing less" principle whi…
141 > - A running task cannot be suspended if task scheduling is locked.
145 > - In an interrupt handler or when a task is locked, the operation of calling **LOS_TaskDelay** fa…
147 > - Locking task scheduling does not disable interrupts. Tasks can still be interrupted while task
149 > - Locking task scheduling must be used together with unlocking task scheduling.
151 > - Task scheduling may occur while a task priority is being set.
153 …For example, if the system software timer occupies one more task resource, the number of task reso…
157 > - If the task corresponding to the task ID sent to **LOS_TaskPriGet** has not been created or the…
159 …sources such as a mutex or a semaphore allocated to a task must have been released before the task
164task scheduling and use of task-related APIs, including creating, delaying, suspending, and resumi…
174 #define TSK_PRIOR_HI 3 /* Priority of a high-priority task. */
175 #define TSK_PRIOR_LO 4 /* Priority of a low-priority task. */
183 …/* Delay the task for 100 ticks. The task is then suspended, and the remaining task with the highe…
190 /* After 100 ticks elapse, the task is resumed. */
193 /* Suspend the task. */
210 …/* Delay the task for 100 ticks. The task is then suspended, and the remaining task with the highe…
219 /* Resume the suspended task g_taskHiId. */
235 …/* Lock task scheduling to prevent newly created tasks from being scheduled prior to this task due…
246 …/* Create a task with higher priority. The task will not be executed immediately after being creat…
262 …/* Create a low-priority task. The task will not be executed immediately after being created, beca…
272 …/* Unlock task scheduling. The task with the highest priority in the Ready queue will be executed.…