当前位置:网站首页>1292_ Implementation analysis of vtask resume() and xtask resume fromisr() in freeros
1292_ Implementation analysis of vtask resume() and xtask resume fromisr() in freeros
2022-07-06 21:39:00 【grey_ csdn】
All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
Today, let's look at a relatively simple interface implementation ,vTaskResume() The implementation of the . It may be that the interface analyzed above has some precipitation , It's really not difficult to see this interface implementation this time , After all, the interface implementation involved in it has been analyzed before .
Many interfaces in the software actually don't work in my current configuration , So the rest of the code itself is not much .
Interface at the beginning , The way of assertion determines the validity of the task handle . Actually , With this , The state of one of the following conditions is confirmed , The later judgment is a little redundant when the assertion is on . The most basic judgment is to see whether the pending task handle is the handle of the current task , If it is , This operation is also meaningless . Because the current task is running , It will not be suspended ,
The basic prerequisites for processing have been met , The next step is to resume the suspended task . Of course , First of all, you have to confirm that the task is suspended . If it is , Remove from the pending task list , Then add it to the ready task list . such , The basic treatment is almost done .
If the scheduler is preemptive , At this time, we have to see whether the priority of the restored task is higher than that of the running task . If it is , That means you need to switch tasks .
This is the implementation of this interface , Relatively simple .
Look at the interruption of the safe version API, First, the validity of the handle is judged , Secondly, I looked at the effectiveness of interrupt priority . There is no need to judge the current execution Task The relationship between , Because in ISR in , Whether the scheduling is running or not is unknown .
Next , The overall treatment is the same as vTaskResume() Little difference , The only difference is the processing when the scheduler hangs .vTaskResume() Execution is in OS The scheduling code of , Therefore, the scheduler must not be suspended . But in ISR in , This is not necessarily , The state of the scheduler may be different . therefore , There is an additional scheduler pending processing .
边栏推荐
- for循环中break与continue的区别——break-完全结束循环 & continue-终止本次循环
- JS operation DOM element (I) -- six ways to obtain DOM nodes
- Fzu 1686 dragon mystery repeated coverage
- 互联网快讯:吉利正式收购魅族;胰岛素集采在31省全面落地
- Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
- 对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
- Summary of cross partition scheme
- Why do job hopping take more than promotion?
- Sql: stored procedures and triggers - Notes
- Nodejs教程之Expressjs一篇文章快速入门
猜你喜欢
[Li Kou brushing questions] one dimensional dynamic planning record (53 change exchanges, 300 longest increasing subsequence, 53 largest subarray and)
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
缓存更新策略概览(Caching Strategies Overview)
JPEG2000-Matlab源码实现
jvm:大对象在老年代的分配
ICML 2022 | flowformer: task generic linear complexity transformer
Seven original sins of embedded development
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果
随机推荐
OneNote in-depth evaluation: using resources, plug-ins, templates
SQL:存储过程和触发器~笔记
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
Reflection operation exercise
ACdreamoj1110(多重背包)
FZU 1686 龙之谜 重复覆盖
Summary of cross partition scheme
在Pi和Jetson nano上运行深度网络,程序被Killed
跨分片方案 总结
It's not my boast. You haven't used this fairy idea plug-in!
启动嵌入式间:资源有限的系统启动
JS traversal array and string
Leetcode topic [array] -118 Yang Hui triangle
JS学习笔记-OO创建怀疑的对象
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
14 years Bachelor degree, transferred to software testing, salary 13.5k
numpy 下载安装
JS operation DOM element (I) -- six ways to obtain DOM nodes
Happy sound 2[sing.2]
Nodejs tutorial expressjs article quick start