当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
- The Interpreter pattern of behavior pattern
- 1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大
- How to start the hidden preferences in coda 2 on the terminal?
- “非洲用户的付费意愿并不低”——专访四达时代研发总监张亮
- Gantt chart grouping activities tutorial
- 汽车维修app开发的好处与功能
- To solve the problem that the data interface is not updated after WPF binding set
- Method of code refactoring -- Analysis of method refactoring
- 2020-08-19: what mechanism does TCP ensure reliability?
猜你喜欢

预留电池接口,内置充放电电路及电量计,迅为助力轻松搞定手持应用

Practice of Xiaoxiong school development board: real equipment access of smart street lamp sandbox experiment

Design of NAND flash interface control

打工人好物——磨炼钢铁意志就要这样高效的电脑

The advantages and functions of psychological counseling app

Google browser realizes video playback acceleration function

“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮

Characteristics of magnetic memory chip STT-MRAM

Plug in bilibilibili new version 0.5.5

大佬们如何在nginx镜像里面增加模块?
随机推荐
7. Swarm builds clusters
Git remote library rollback specified version
Common syntax corresponding table of mongodb and SQL
python3操作Jenkins模块api
The advantages and functions of psychological counseling app
20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
三步轻松理解Kerberos协议
Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
7.Swarm搭建集群
FreeSWITCH视频会议“标准”解决方案
List to map (split the list according to the key, and the value of the same key is a list)
8.Swarm创建维护和水平扩展Service
频收罚单的浦发银行:增收不增利,曾遭骗贷数亿元,内控缺位?
Stm32f030f4p6 compatible with smart micro mm32f031f4p6
New features of vue3
Composition of MRAM cache
Google browser realizes video playback acceleration function
C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
2020-08-29: process thread differences, in addition to the inclusion relationship, the underlying details?
如何解决谷歌Chrome浏览器空白页的问题