当前位置:网站首页>2020-11-06: go, let's talk about the scheduler.
2020-11-06: go, let's talk about the scheduler.
2020-11-06 22:43:00 【Fuda Dajia architect's daily question】
Fogo's answer 2020-11-06:
·MPG Model :goroutine The concurrency model of can be summarized as MPG Model ;
·MPG Concept : Threads (machine, System threads , Physical threads )- kernel (processor)- coroutines (goroutine, User threads , Logical threads );
· Many to many scheduling model : The overall scheduling follows the many to many model , Multiple collaborations ( About a million ) Scheduling in multiple threads at the same time ( About a thousand ) Next ;
·LRQ(LocalRunningQueue): Local run queue , One M Execute in a P In the context of ,P There is a G queue ;
·GRQ(GlobalRunningQueue): Global run queue ,G Not initialized or not LRQ When it's ready to mount, it's thrown in GRQ;
·GRQ=>LRQ:MP Will be in LRQ Check after execution GRQ, And steal the task from it and mount it to the current LRQ In the implementation of , They also have regular checks ;
· The purpose of scheduling is : The purpose of scheduling is to prevent thread blocking 、 idle 、 By OS Hang up (syscall);
· Prevent threads M jam :G1 coroutines IO When you leave MP,G2 From the current MP Of LRQ Pop up and execute ;
· Prevent threads M idle :M1 When idle , From M2 Of LRQ To steal half of the mission , Mount to your own LRQ In the implementation of ;
· Prevent threads M By OS Hang up (syscall):P With LRQ Hang to the bottom of other threads to execute , When syscall At the end ,M Will try to G0 Mount to other LRQ Medium or GRQ in ;
detailed go Scheduler model reference :
Go Chinese language network :https://studygolang.com/articles/9610
Simple books :https://www.jianshu.com/p/f9024e250ac6
版权声明
本文为[Fuda Dajia architect's daily question]所创,转载请带上原文链接,感谢
边栏推荐
- ado.net and asp.net The relationship between
- Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
- Two dimensional code location and alarm system of Expressway
- 迅为iMX6开发板-设备树内核-menuconfig的使用
- 频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
- JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
- 如何解决谷歌Chrome浏览器空白页的问题
- 小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
- Stm32f030f4p6 compatible with smart micro mm32f031f4p6
- Dynamsoft barcode reader v7.5!
猜你喜欢
如何才能快速正确的部署甘特图
jenkins pipline stage 设置超时
Mongo user rights login instruction
JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
Exclusive interview of guests at | 2020 PostgreSQL Asia Conference: Wang Tao
Stm32f030c6t6 compatible to replace mm32spin05pf
In 2020, how can wechat seal numbers be quickly lifted?
Empty test suite appears in JUnit test
ImageMagick - add watermark
Points to be considered when deleting mapping field of index in ES
随机推荐
New features of vue3
How to add modules to nginx image?
Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment
Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing
The essence of transaction and the principle of deadlock
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
The use of Xunwei imx6 development board device tree kernel menuconfig
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
高速公路二维码定位报警系统
About Devops seven misunderstandings, 99% of people have been hit!
1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
谈了多年的数字化转型,为什么还有很多企业依然“口头管理”
Experiment one
Image processing toolkit imagexpresshow to view events
Erd-online free online database modeling tool
如何创建交互式内核密度图表
条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用
Characteristics of magnetic memory chip STT-MRAM
如何才能快速正确的部署甘特图