当前位置:网站首页>1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
2022-07-04 03:43:00 【grey_ csdn】
All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
Except for a few minor problems , The analysis was suspended for some time . Fortunately, I wrote more recently 2 Analysis of interfaces , Daily learning inertia does not stop . Take a look today vTaskSuspend() Interface implementation , It's the first time for me to recover .

First , This API Relevant functions can only be realized after the configuration takes effect . First , Enter critical protection , Prevent the impact of interruptions . Then get the task handle , Then remove the corresponding task from the ready task list . If you remove , The ready task list of the corresponding task priority is empty , Then you need to reset the linked list .

If the task is waiting for the event to happen , Then we should also deal with the related linked list relationship . When these two parts are finished , Add the task to the pending task list .

If the task is still waiting for notification , Then we should also deal with the waiting state .

This interface can be called from interrupts , Therefore, there may be situations where the scheduler does not run . Now , The next blocking contact time point needs to be reset , Prevent operation on the current task .

If the task to be suspended is the current task , It depends on whether the scheduler is running . If the scheduler is running , Then you need to perform a task scheduling . If the scheduler is not running , Need to see OS All tasks in have been suspended . If all tasks are suspended , At present TCB Pointer to NULL, Otherwise, request a context switch . This context switch has been analyzed before , In essence, it is the task with the highest priority that is ready , Give Way pxCurrentTCB Points to the highest priority task ready TCB.
This interface is still very simple , It can be well understood by combining several basic concepts of the operating system .
边栏推荐
- functools下的reduce函数
- Es network layer
- 基于PHP的轻量企业销售管理系统
- Database SQL statement summary, continuous update
- Typical applications of minimum spanning tree
- Command Execution Vulnerability - command execution - vulnerability sites - code injection - vulnerability exploitation - joint execution - bypass (spaces, keyword filtering, variable bypass) - two ex
- EV6 helps the product matrix, and Kia is making efforts in the high-end market. The global sales target in 2022 is 3.15 million?
- SQL statement strengthening exercise (MySQL 8.0 as an example)
- postgresql 用户不能自己创建表格配置
- Detailed explanation of PPTC self recovery fuse
猜你喜欢

Detailed explanation of PPTC self recovery fuse
![[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush](/img/98/3e5f1094141e34d7e77f908e12acda.jpg)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush

Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!

Add IDM to Google browser

Explain AI accelerator in detail: why is this the golden age of AI accelerator?

No clue about the data analysis report? After reading this introduction of smartbi, you will understand!

Wechat official account web page authorization

Leetcode51.n queen

PID of sunflower classic

Tcpclientdemo for TCP protocol interaction
随机推荐
[PaddleSeg 源码阅读] PaddleSeg计算 mIoU
JSON string conversion in unity
Go 语言入门很简单:Go 实现凯撒密码
How to use websocket to realize simple chat function in C #
Recursive structure
图解网络:什么是热备份路由器协议HSRP?
2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
1day vulnerability pushback skills practice (3)
Sword finger offer:55 - I. depth of binary tree
Learning video website
Typical applications of minimum spanning tree
Calculate the odd sum of 1~n (1~100 as an example)
Recent learning fragmentation (14)
渗透实战-SQLServer提权
Why is it recommended that technologists write blogs?
Don't disagree, this is the most powerful "language" of the Internet
Teach you how to optimize SQL
The property of judging odd or even numbers about XOR.
[database I] database overview, common commands, view the table structure of 'demo data', simple query, condition query, sorting data, data processing function (single row processing function), groupi
Leecode 122. Zuijia timing of buying and selling stocks ②