当前位置:网站首页>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 .
边栏推荐
- Mindmanager2022 efficient and easy to use office mind map MindManager
- Defensive programming skills
- Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
- Wechat official account web page authorization
- [paddleseg source code reading] paddleseg calculates Miou
- Session learning diary 1
- what does ctrl + d do?
- logistic regression
- functools下的reduce函数
- [paddleseg source code reading] normalize operation of paddleseg transform
猜你喜欢
Teach you how to optimize SQL
Have you entered the workplace since the first 00???
三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
Monitoring - Prometheus introduction
Audio and video technology development weekly | 232
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
Setting methods, usage methods and common usage scenarios of environment variables in postman
Want to do something in production? Then try these redis commands
Sales management system of lightweight enterprises based on PHP
随机推荐
图解网络:什么是热备份路由器协议HSRP?
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
How much does it cost to open a futures account in China? Where is it safe to open an account at present?
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类
SQL语句加强练习(MySQL8.0为例)
Database SQL statement summary, continuous update
Day05 錶格
How to use websocket to realize simple chat function in C #
Apple submitted the new MAC model to the regulatory database before the spring conference
1day vulnerability pushback skills practice (3)
Setting methods, usage methods and common usage scenarios of environment variables in postman
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
Objective-C description method and type method
Katalon框架测试web(二十六)自动发邮件
Objective-C string class, array class
super_ Subclass object memory structure_ Inheritance tree traceability
The property of judging odd or even numbers about XOR.
疫情来袭--远程办公之思考|社区征文
MySQL backup notes
Future源碼一觀-JUC系列