当前位置:网站首页>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 .
边栏推荐
- Katalon框架测试web(二十六)自动发邮件
- [paddleseg source code reading] paddleseg custom data class
- [.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client
- 新型数据中心,助力加快构建以数据为关键要素的数字经济
- super_ Subclass object memory structure_ Inheritance tree traceability
- Apple submitted the new MAC model to the regulatory database before the spring conference
- Baijia forum the founding of the Eastern Han Dynasty
- Webhook triggers Jenkins for sonar detection
- How much does it cost to open a futures account in China? Where is it safe to open an account at present?
- Rhcsa day 2
猜你喜欢

JVM family -- monitoring tools

National standard gb28181 protocol platform easygbs fails to start after replacing MySQL database. How to deal with it?

Setting methods, usage methods and common usage scenarios of environment variables in postman

Leetcode51.n queen

JSON string conversion in unity

Defensive programming skills

Select sorting and bubble sorting template

三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量

PID of sunflower classic

渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
随机推荐
新型数据中心,助力加快构建以数据为关键要素的数字经济
Slurm view node configuration information
Teach you how to optimize SQL
Leecode 122. Zuijia timing of buying and selling stocks ②
Katalon框架测试web(二十六)自动发邮件
Want to do something in production? Then try these redis commands
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
[paddleseg source code reading] paddleseg calculates Miou
JSON string conversion in unity
Summary of Chinese remainder theorem
Es network layer
If you have just joined a new company, don't be fired because of your mistakes
No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
2022 Guangxi provincial safety officer a certificate examination materials and Guangxi provincial safety officer a certificate simulation test questions
How to pipe several commands in Go?
PID of sunflower classic
MySQL data query optimization -- data structure of index
Which product is better if you want to go abroad to insure Xinguan?
warning: LF will be replaced by CRLF in XXXXXX