当前位置:网站首页>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 .
边栏推荐
- mysql数据库的存储
- 微信公众号网页授权
- Eh, the log time of MySQL server is less than 8h?
- New year's first race, submit bug reward more!
- pytest多进程/多线程执行测试用例
- [source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
- Why is it recommended that technologists write blogs?
- MySQL one master multiple slaves + linear replication
- Sword finger offer:55 - I. depth of binary tree
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
猜你喜欢
Code Execution Vulnerability - no alphanumeric rce create_ function()
What is the difference between enterprise wechat applet and wechat applet
PHP database connection succeeded, but data cannot be inserted
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
The difference between MCU serial communication and parallel communication and the understanding of UART
Recursive structure
1day vulnerability pushback skills practice (3)
渗透实战-SQLServer提权
Why is it recommended that technologists write blogs?
Rhcsa day 3
随机推荐
Es network layer
Objective-C description method and type method
Leetcode51.n queen
Detailed explanation of PPTC self recovery fuse
Value transfer communication between components (parent to child, child to parent, brother component to value)
What are the virtual machine software? What are their respective functions?
Stm32bug [stlink forced update prompt appears in keilmdk, but it cannot be updated]
[paddleseg source code reading] paddleseg calculation dice
@Scheduled scheduled tasks
“软硬皆施”,助力建成新型云计算数据中心
What kind of experience is it when the Institute earns 20000 yuan a month!
Defensive programming skills
新型数据中心,助力加快构建以数据为关键要素的数字经济
Recent learning fragmentation (14)
Session learning diary 1
2022 Guangxi provincial safety officer a certificate examination materials and Guangxi provincial safety officer a certificate simulation test questions
如何有效远程办公之我见 | 社区征文
Monitoring - Prometheus introduction
1day vulnerability pushback skills practice (3)
SQL语句加强练习(MySQL8.0为例)