当前位置:网站首页>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的状态看不清。第一个是各个链表的作用以及状态切换时候的转移关系;另一个是阻塞以及接触阻塞的操作逻辑。这些,后面作为专门的笔记进行梳理。
边栏推荐
- 35岁真就成了职业危机?不,我的技术在积累,我还越吃越香了
- 2022.7.7-----leetcode. six hundred and forty-eight
- Detailed explanation of interview questions: the history of blood and tears in implementing distributed locks with redis
- ROS从入门到精通(九) 可视化仿真初体验之TurtleBot3
- 一鍵免費翻譯300多頁的pdf文檔
- Introduction knowledge system of Web front-end engineers
- STM32F1与STM32CubeIDE编程实例-旋转编码器驱动
- 商品的设计等整个生命周期,都可以将其纳入到产业互联网的范畴内
- [leetcode] 20. Valid brackets
- 【测试面试题】页面很卡的原因分析及解决方案
猜你喜欢

Kubectl's handy command line tool: Oh my Zsh tips and tricks

备库一直有延迟,查看mrp为wait_for_log,重启mrp后为apply_log但过一会又wait_for_log

52岁的周鸿祎,还年轻吗?

Two small problems in creating user registration interface

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

DNS 系列(一):为什么更新了 DNS 记录不生效?

Data Lake (XV): spark and iceberg integrate write operations

FFA and ICGA angiography

Solutions to problems in sqlserver deleting data in tables

SQL connection problem after downloading (2)
随机推荐
用語雀寫文章了,功能真心强大!
Trust orbtk development issues 2022
[question de programmation] [scratch niveau 2] oiseaux volants en décembre 2019
Fully automated processing of monthly card shortage data and output of card shortage personnel information
快速上手使用本地测试工具postman
Operating system principle --- summary of interview knowledge points
2022-07-07:原本数组中都是大于0、小于等于k的数字,是一个单调不减的数组, 其中可能有相等的数字,总体趋势是递增的。 但是其中有些位置的数被替换成了0,我们需要求出所有的把0替换的方案数量:
Robomaster visual tutorial (0) Introduction
哪个券商公司开户佣金低又安全,又靠谱
Usage of limit and offset (Reprint)
Data Lake (XV): spark and iceberg integrate write operations
Robomaster visual tutorial (10) target prediction
3年经验,面试测试岗20K都拿不到了吗?这么坑?
CoinDesk评波场去中心化进程:让人们看到互联网的未来
ROS从入门到精通(九) 可视化仿真初体验之TurtleBot3
关于组织2021-2022全国青少年电子信息智能创新大赛西南赛区(四川)复赛的通知
[programming problem] [scratch Level 2] draw ten squares in December 2019
The difference between get and post
How can CSDN indent the first line of a paragraph by 2 characters?
Problems faced when connecting to sqlserver after downloading (I)