当前位置:网站首页>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 .
边栏推荐
- string的底层实现
- JS操作dom元素(一)——获取DOM节点的六种方式
- C language char, wchar_ t, char16_ t, char32_ Relationship between T and character set
- Yuan Xiaolin: safety is not only a standard, but also Volvo's unchanging belief and pursuit
- ICML 2022 | flowformer: task generic linear complexity transformer
- Absolute primes (C language)
- Forward maximum matching method
- Web开发小妙招:巧用ThreadLocal规避层层传值
- FZU 1686 龙之谜 重复覆盖
- Leetcode topic [array] -118 Yang Hui triangle
猜你喜欢
Efficiency tool +wps check box shows the solution to the sun problem
Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
Seven original sins of embedded development
[interpretation of the paper] machine learning technology for Cataract Classification / classification
It's not my boast. You haven't used this fairy idea plug-in!
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
uni-app App端半屏连续扫码
MLP (multilayer perceptron neural network) is a multilayer fully connected neural network model.
【滑动窗口】第九届蓝桥杯省赛B组:日志统计
Fastjson parses JSON strings (deserialized to list, map)
随机推荐
袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
代理和反向代理
The underlying implementation of string
uni-app App端半屏连续扫码
Sql: stored procedures and triggers - Notes
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
JS learning notes OO create suspicious objects
mysql根据两个字段去重
在最长的距离二叉树结点
js中,字符串和数组互转(二)——数组转为字符串的方法
R3live notes: image processing section
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
Is this the feeling of being spoiled by bytes?
This year, Jianzhi Tencent
Redistemplate common collection instructions opsforzset (VI)
Why do job hopping take more than promotion?
Thinking about agile development
Nodejs教程之让我们用 typescript 创建你的第一个 expressjs 应用程序
在Pi和Jetson nano上运行深度网络,程序被Killed
C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果