当前位置:网站首页>1293_FreeRTOS中xTaskResumeAll()接口的实现分析
1293_FreeRTOS中xTaskResumeAll()接口的实现分析
2022-07-07 22:18:00 【grey_csdn】
全部学习汇总: GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
这次分析的xTaskResumeAll()接口其实还是小有复杂度的,但是相关的概念清晰了理解起来不难。

进行恢复操作的前提是调度器不能够挂起。

首先,与挂起的工作做了一个反操作,主要是处理一个标志性计数器。
接着查看现在的OS中任务数目,如果任务数目大于0继续往下的处理才有意义。接下来,进行“挂起任务链表的清空”。也就是从中一个个节点取出,从挂起链表以及状态链表中移除,加入到就绪任务链表中。如果发现了高优先级的任务就绪了,标注一下后面需要进行任务调度。

如果前面发现了挂起的任务,那么复位下一次的阻塞解除时间。根据调度器“落后的”调度次数,调度tick的回调函数进行调度的追加。这个过程中处理的只是任务链表,没有实际的调度发生。如果发现需要调度,那么也需要标记一下接下来需要进行任务调度切换。

根据前面的判断信息,如果发现需要任务切换那么就执行切换。
这样,这个接口基本分析完了。但是,还是有一些概念后续需要重新理顺下,不然整个OS的状态看不清。第一个是各个链表的作用以及状态切换时候的转移关系;另一个是阻塞以及接触阻塞的操作逻辑。这些,后面作为专门的笔记进行梳理。
边栏推荐
- Pigsty: out of the box database distribution
- Teach you to make a custom form label by hand
- How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary
- FFA and ICGA angiography
- The underlying principles and templates of new and delete
- 面试题详解:用Redis实现分布式锁的血泪史
- The difference between -s and -d when downloading packages using NPM
- One click free translation of more than 300 pages of PDF documents
- 【转载】解决conda安装pytorch过慢的问题
- 从服务器到云托管,到底经历了什么?
猜你喜欢

Basic learning of SQL Server -- creating databases and tables with the mouse
![[研发人员必备]paddle 如何制作自己的数据集,并显示。](/img/50/3d826186b563069fd8d433e8feefc4.png)
[研发人员必备]paddle 如何制作自己的数据集,并显示。

Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)

80%的人答错,苹果logo上的叶子到底朝左还是朝右?

C language 005: common examples

从服务器到云托管,到底经历了什么?

80% of the people answered incorrectly. Does the leaf on the apple logo face left or right?

The result of innovation in professional courses such as robotics (Automation)

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
![[programming questions] [scratch Level 2] March 2019 garbage classification](/img/08/9f7ebf4302c9239784751b579c9efc.png)
[programming questions] [scratch Level 2] March 2019 garbage classification
随机推荐
How to add automatic sorting titles in typora software?
【編程題】【Scratch二級】2019.12 飛翔的小鳥
[programming problem] [scratch Level 2] 2019.09 make bat Challenge Game
ROS从入门到精通(九) 可视化仿真初体验之TurtleBot3
詹姆斯·格雷克《信息简史》读后感记录
Use filters to count URL request time
Set up personal network disk with nextcloud
每日刷题记录 (十六)
Relevant methods of sorting arrays in JS (if you want to understand arrays, it's enough to read this article)
某马旅游网站开发(对servlet的优化)
单机高并发模型设计
Using Google test in QT
【leetcode】day1
C language 001: download, install, create the first C project and execute the first C language program of CodeBlocks
关于组织2021-2022全国青少年电子信息智能创新大赛西南赛区(四川)复赛的通知
全自动化处理每月缺卡数据,输出缺卡人员信息
Data Lake (XV): spark and iceberg integrate write operations
limit 与offset的用法(转载)
[programming questions] [scratch Level 2] March 2019 garbage classification
How to measure whether the product is "just needed, high frequency, pain points"