当前位置:网站首页>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的状态看不清。第一个是各个链表的作用以及状态切换时候的转移关系;另一个是阻塞以及接触阻塞的操作逻辑。这些,后面作为专门的笔记进行梳理。
边栏推荐
- 51与蓝牙模块通讯,51驱动蓝牙APP点灯
- Introduction to programming hardware
- Is Zhou Hongyi, 52, still young?
- [programming problem] [scratch Level 2] 2019.09 make bat Challenge Game
- Development of a horse tourism website (realization of login, registration and exit function)
- Solutions to problems in sqlserver deleting data in tables
- Scrapy framework
- 【编程题】【Scratch二级】2019.03 绘制方形螺旋
- Install sqlserver2019
- Opengl3.3 mouse picking up objects
猜你喜欢

【编程题】【Scratch二级】2019.03 绘制方形螺旋

【编程题】【Scratch二级】2019.12 飞翔的小鸟

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

STM32F1与STM32CubeIDE编程实例-旋转编码器驱动

Robomaster visual tutorial (1) camera
![[programming problem] [scratch Level 2] draw ten squares in December 2019](/img/4f/14ea8e786b7f8b0a263aa5c55abf15.png)
[programming problem] [scratch Level 2] draw ten squares in December 2019

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

Coindesk comments on the decentralization process of the wave field: let people see the future of the Internet

从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值

Trust orbtk development issues 2022
随机推荐
51与蓝牙模块通讯,51驱动蓝牙APP点灯
Binary sort tree [BST] - create, find, delete, output
new和delete的底层原理以及模板
Database interview questions + analysis
[programming problem] [scratch Level 2] draw ten squares in December 2019
STM32F1與STM32CubeIDE編程實例-旋轉編碼器驅動
Les mots ont été écrits, la fonction est vraiment puissante!
Pypharm uses, and the third-party library has errors due to version problems
Teach you to make a custom form label by hand
Redis caching tool class, worth owning~
The difference between get and post
ROS from entry to mastery (IX) initial experience of visual simulation: turtlebot3
【编程题】【Scratch二级】2019.12 绘制十个正方形
从服务器到云托管,到底经历了什么?
Tools for debugging makefiles - tool for debugging makefiles
Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
Visual Studio Deployment Project - Create shortcut to deployed executable
Data Lake (XV): spark and iceberg integrate write operations
Coindesk comments on the decentralization process of the wave field: let people see the future of the Internet
【推荐系统基础】正负样本采样和构造