当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
- Python 3 operates the Jenkins module API
- Cloudquery v1.2.0 release
- .NETCore3.1+Vue.js打造的低代码工作流引擎
- 8.Swarm创建维护和水平扩展Service
- Epu360: all the H5 templates you want are here, e-book, big turntable, red envelope rain, questionnaire survey
- Nanjing logo design and production, guide VI system design
- Python3 operating gitlab
- ImageMagick - add watermark
- C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
猜你喜欢

汽车维修app开发的好处与功能

How to optimize the decoding performance of dynamsoft barcode reader

How to deploy Gantt chart quickly and correctly

2020-08-17: how to solve data skew in detail?

How to start the hidden preferences in coda 2 on the terminal?

How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?

RFID fixed assets management system for fire equipment

#JVM 类加载机制

1万辆!理想汽车召回全部缺陷车:已发生事故97起,亏损将扩大

image operating system windows cannot be used on this platform
随机推荐
JS string - string string object method
移动端像素适配方案
7. Swarm builds clusters
The first choice for lightweight GPU applications is the NVIDIA vgpu instance launched by Jingdong Zhilian cloud
Git remote library rollback specified version
Es create a new index database and copy the old index library, practice pro test effective!
The memorandum model of behavior model
[graffiti Internet of things footprints] panoramic introduction of graffiti cloud platform
Design of NAND flash interface control
New features of vue3
In 2020, how can wechat seal numbers be quickly lifted?
Big data processing black Technology: revealing the parallel computing technology of Pb level data warehouse gaussdb (DWS)
Dynamsoft barcode reader v7.5!
vue3 新特性
LEADTOOLS如何检测,读取和写入条形码
2020-08-20: the difference between go and python?
20 XR projects roadshows, nearly 20 capital institutions attended! We sincerely invite you to attend the 2020 qcomm XR eco Partner Conference
条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
Google browser realizes video playback acceleration function
How to create an interactive kernel density chart