当前位置:网站首页>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 .
边栏推荐
- R语言做文本挖掘 Part4文本分类
- ICML 2022 | flowformer: task generic linear complexity transformer
- One line by line explanation of the source code of anchor free series network yolox (a total of ten articles, you can change the network at will after reading it, if you won't complain to me)
- Thinking about agile development
- Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
- R3live notes: image processing section
- 2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history
- 14年本科毕业,转行软件测试,薪资13.5K
- 1D convolution detail
- MySQL - 事务(Transaction)详解
猜你喜欢
随机推荐
js通过数组内容来获取数组下标
快讯:飞书玩家大会线上举行;微信支付推出“教培服务工具箱”
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
This year, Jianzhi Tencent
[sliding window] group B of the 9th Landbridge cup provincial tournament: log statistics
PostgreSQL 安装gis插件 CREATE EXTENSION postgis_topology
Numpy download and installation
Enhance network security of kubernetes with cilium
b站视频链接快速获取
袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
Guava: three ways to create immutablexxx objects
字符串的使用方法之startwith()-以XX开头、endsWith()-以XX结尾、trim()-删除两端空格
【滑动窗口】第九届蓝桥杯省赛B组:日志统计
How do I remove duplicates from the list- How to remove duplicates from a list?
JPEG2000 matlab source code implementation
string的底层实现
[redis design and implementation] part I: summary of redis data structure and objects
Redistemplate common collection instructions opsforzset (VI)
KDD 2022 | realize unified conversational recommendation through knowledge enhanced prompt learning
2022 fields Award Announced! The first Korean Xu Long'er was on the list, and four post-80s women won the prize. Ukrainian female mathematicians became the only two women to win the prize in history





![Leetcode topic [array] -118 Yang Hui triangle](/img/77/d8a7085968cc443260b4c0910bd04b.jpg)


