Lines Matching refs:task

8 In the OpenHarmony kernel, a task represents a thread.
16 …er-priority task can preempt resources of a lower-priority task. The lower-priority task can be sc…
20 - Init: The task is being created.
22 - Ready: The task is in the Ready queue and waits for scheduling by the CPU.
24 - Running: The task is running.
26 - Blocked: The task is blocked and suspended. The Blocked states include pending (blocked due to lo…
28 - Exit: The task is complete and waits for the parent task to reclaim its control block resources.
32 ![](figures/task-state-transition.png "task-state-transition")
37 …en a task is created, the task obtains the control block and enters the Init state (initialization…
40 …hen a task switching is triggered, the task with the highest priority in the Ready queue is execut…
43task is blocked (for example, is pended, delayed, or reading semaphores), its state changes from R…
46 …the blocked task is restored (the task is restored, the delay times out, the semaphore reading tim…
49 …When a task in the Ready state is blocked (suspended), the task changes to the Blocked state and i…
52task with a higher priority is created or recovered, tasks will be scheduled. The task with the hi…
55 …When a running task is complete, it changes to the Exit state. If the task has a detach attribute …
60task management module provides the following functions: creating, delaying, suspending, and resto…
62task, the system initializes the task stack and presets the context. The system places the task en…
70 **Table 1** APIs for creating and deleting a task
74 …| Creates a task. If the priority of the created task is higher than that of the task in running a…
75 | LOS_TaskCreateOnly | Creates a task and blocks it. The task will not be added to the Ready queue …
76 | LOS_TaskDelete | Deletes a task and reclaims the resources consumed by the task control block…
78 **Table 2** APIs for controlling task status
82 | LOS_TaskResume | Resumes a suspended task. |
83 | LOS_TaskSuspend | Suspends a task. The suspended task will be removed from the Ready queue. …
84 | LOS_TaskJoin | Blocks the current task until the specified task is complete, and reclaims its …
85 …Detach | Changes the task attribute from **joinable** to **detach**. When a task of the **detach*…
86 | LOS_TaskDelay | Delays the current task for the specified time (number of ticks). |
87 | LOS_TaskYield | Moves the current task from the queue of the tasks with the same priority to th…
89 **Table 3** APIs for task scheduling
93 | LOS_TaskLock | Locks task scheduling to prevent task switching. …
94 …lock | Unlocks task scheduling. After that, the task lock count decrements by 1. If a task i…
95 | LOS_GetTaskScheduler | Obtains the scheduling policy of a task. …
96 …e scheduling parameters, including the priority and scheduling policy, for a task. |
97 | LOS_Schedule | Triggers active task scheduling. |
99 **Table 4** APIs for obtaining task information
103 | LOS_CurTaskIDGet | Obtains the ID of the current task. |
104 | LOS_TaskInfoGet | Obtains task information. |
107 **Table 5** APIs for managing task priorities
111 | LOS_CurTaskPriSet | Sets a priority for the current task.|
112 | LOS_TaskPriSet | Sets a priority for a task. |
113 | LOS_TaskPriGet | Obtains the priority of a task. |
119 | LOS_TaskCpuAffiSet | Binds a task to the specified CPU core. This API is used only in multi-core …
120 | LOS_TaskCpuAffiGet | Obtains information about the core binding of a task. This API is used only …
126 The typical task development process is as follows:
128 1. Call **LOS_TaskCreate** to create a task.
129 - Specify the execution entry function for the task.
130 - Specifies the task name.
131 - Specify the task stack size.
132 - Specify the priority of the task.
133 …- Specify the task attribute, which can be **LOS_TASK_ATTR_JOINABLE** or **LOS_TASK_STATUS_DETACHE…
134 - Specify the task-core binding attribute for multi-core environment.
136 2. Run the service code to implement task scheduling.
138task is complete. If the task attribute is **LOS_TASK_STATUS_DETACHED**, the task resources are au…
144 > - If a task is created after a user-mode process enters the kernel mode by a system call, the tas…
161 …/* Delay the task for 2 ticks. The task is suspended, and the remaining task with the highest prio…
167 /* After 2 ticks elapse, the task is resumed and executed. */
169 /* Suspend the task. */
179 /* Entry function of the low-priority task. */
184 …/* Delay the task for 2 ticks. The task is suspended, and the remaining task with the highest prio…
191 /* Resume the suspended task g_taskHiID. */
200 /* Create two tasks with different priorities in the task test entry function. */
206 /* Lock task scheduling. */
209 …/* Parameters used to initialize the high-priority task, the resources of which can be reclaimed b…
216 …/* Create a task with higher priority. The task will not be executed immediately after being creat…
225 …Parameters used to initialize the low-priority task, which will be automatically destroyed after t…
232 …/* Create a low-priority task. The task will not be executed immediately after being created, beca…
241 …/* Unlock task scheduling. The task with the highest priority in the Ready queue will be executed.…