当前位置:网站首页>Zephyr Learning note 2, Scheduling
Zephyr Learning note 2, Scheduling
2022-07-04 07:17:00 【Mayiqx】
Chapitre II:Scheduler(Scheduling).
L'ordonnanceur basé sur les priorités du noyau permet le partage de Threads pour les applicationsCPU.
Le thread passe de l'état d'exécution à l'état en attente ou en attente,Par exemplek_sem_take()Ouk_sleep().
Le thread passe à l'état prêt,Par exemple, en utilisantk_sem_give()Ouk_thread_start().
Renvoie le contexte du thread après le traitement de l'interruption,Quand le thread en cours d'exécution appellek_yield()Heure.
Lorsque le thread démarre activement une opération qui se convertit en état suspendu ou en attente,Il va dormir..
Collaborative

Préemption


Scheduler Locking
Les Threads préemptibles qui ne veulent pas être préemptés lors de l'exécution d'opérations critiques peuvent être appelés park_sched_lock().Une fois les opérations critiques terminées,Le thread préemptable doit appelerk_sched_unlock()Pour rétablir son état préemptif normal.
Thread Sleeping
k_sleep()
k_wakeup()
Le thread peut appelerk_busy_wait() Pour effectuer une attente chargée , L'attente retarde son traitement pour la période spécifiée ,Et nonCPU Jeter à un autre fil prêt .
CPU Idling
static k_sem my_sem;
void my_isr(void *unused)
{
k_sem_give(&my_sem);
}
void main(void)
{
k_sem_init(&my_sem, 0, 1);
/* wait for semaphore from ISR, then do related work */
for (;;) {
/* wait for ISR to trigger work to perform */
if (k_sem_take(&my_sem, K_NO_WAIT) == 0) {
/* ... do processing */
}
/* put CPU to sleep to save power */
k_cpu_idle();
}
}边栏推荐
- Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
- Set JTAG fuc invalid to normal IO port
- win10微软拼音输入法输入文字时候下方不出现中文提示
- ABCD four sequential execution methods, extended application
- 两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
- JS common time processing functions
- The IP bound to the socket is inaddr_ The meaning of any htonl (inaddr_any) (0.0.0.0 all addresses, uncertain addresses, arbitrary addresses)
- NLP literature reading summary
- tornado之目录
- Directory of tornado
猜你喜欢

Centos8 install mysql 7 unable to start up

com. alibaba. nacos. api. exception. NacosException

The most effective futures trend strategy: futures reverse merchandising
![[Flink] temporal semantics and watermark](/img/4d/cf9c7e80ea416155cee62cdec8a5bb.jpg)
[Flink] temporal semantics and watermark

Deep profile data leakage prevention scheme

Bottom problem of figure

uniapp小程序分包

两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙

Technical experts from large factories: common thinking models in architecture design

flask-sqlalchemy 循环引用
随机推荐
电子协会 C语言 1级 34 、分段函数
Adaptive spatiotemporal fusion of multi-target networks for compressed video perception enhancement
When JDBC connects to es query, is there a God who meets the following situation?
Rhcsa the next day
Cochez une colonne d'affichage dans une colonne de tableau connue
Responsive mobile web test questions
【FPGA教程案例7】基于verilog的计数器设计与实现
Vulhub vulnerability recurrence 77_ zabbix
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
Lottery system test report
"Sword finger offer" 2nd Edition - force button brush question
uniapp小程序分包
输入年份、月份,确定天数
Cell reports: Wei Fuwen group of the Institute of zoology, Chinese Academy of Sciences analyzes the function of seasonal changes in the intestinal flora of giant pandas
Literature collation and thesis reading methods
Directory of tornado
How can the old version of commonly used SQL be migrated to the new version?
Introduction to spark core components
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
Design of test cases