当前位置:网站首页>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 .
边栏推荐
- Seven original sins of embedded development
- 互联网快讯:吉利正式收购魅族;胰岛素集采在31省全面落地
- ViT论文详解
- js通过数组内容来获取数组下标
- @GetMapping、@PostMapping 和 @RequestMapping详细区别附实战代码(全)
- c语言char, wchar_t, char16_t, char32_t和字符集的关系
- 愛可可AI前沿推介(7.6)
- OneNote in-depth evaluation: using resources, plug-ins, templates
- Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
- Fastjson parses JSON strings (deserialized to list, map)
猜你喜欢

Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)

Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"

50 commonly used numpy function explanations, parameters and usage examples
![[Li Kou brush questions] 32 Longest valid bracket](/img/51/1ce4f9e8517dba214ec82b6567c923.png)
[Li Kou brush questions] 32 Longest valid bracket

Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?

After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers

【Redis设计与实现】第一部分 :Redis数据结构和对象 总结

50个常用的Numpy函数解释,参数和使用示例

Numpy download and installation
Why does MySQL index fail? When do I use indexes?
随机推荐
[go][reprint]vscode run a HelloWorld example after configuring go
14 years Bachelor degree, transferred to software testing, salary 13.5k
Quick access to video links at station B
Explain ESM module and commonjs module in simple terms
Technology sharing | packet capturing analysis TCP protocol
MySQL - transaction details
Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software
SQL:存储过程和触发器~笔记
50个常用的Numpy函数解释,参数和使用示例
Redistemplate common collection instructions opsforzset (VI)
Dialogue with Jia Yangqing, vice president of Alibaba: pursuing a big model is not a bad thing
Hill | insert sort
Why do job hopping take more than promotion?
Divide candy
Seven original sins of embedded development
What about the spectrogram
抖音將推獨立種草App“可頌”,字節忘不掉小紅書?
Thinking about agile development