当前位置:网站首页>1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS

1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS

2022-07-08 00:22:00 grey_ csdn

All learning summary : GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)

This analysis is xTaskResumeAll() The interface is actually a little complicated , But the related concepts are clear and easy to understand .

The premise of recovery operation is that the scheduler cannot suspend .

First , Doing a reverse operation with the suspended work , It mainly deals with a symbolic counter .

Then check the current OS Number of tasks in , If the number of tasks is greater than 0 It's meaningful to continue to deal with it . Next , Conduct “ Suspend the emptying of the task list ”. That is, take out one node after another , Remove from the pending list and the status list , Add to the ready task list . If a high priority task is found, it is ready , Note that task scheduling is required later .

If you find a pending task , Then reset the next blocking release time . According to the scheduler “ backward ” Scheduling times , Dispatch tick Callback function to schedule the addition . In this process, we only deal with the task list , No actual scheduling occurs . If it is found that scheduling is needed , Then you also need to mark the next task scheduling switch .

According to the previous judgment information , If it is found that task switching is required, then perform switching .

such , This interface is basically analyzed . however , There are still some concepts that need to be straightened out later , Or the whole OS I can't see clearly . The first is the function of each linked list and the transfer relationship during state switching ; The other is the operation logic of blocking and contact blocking . these , Later, it will be combed as special notes .

原网站

版权声明
本文为[grey_ csdn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/189/202207072217516742.html