0. Preface
The previous ten lectures introduced the Go runtime scheduler, and this lecture provides a general overview of the Go runtime scheduler along with some diagrams.
1. State transition diagrams
First is the state transition diagram of the Goroutine:
Most of the transfer paths have also been described in previous lectures and will not be continued here (below).
Next is the state transfer diagram for P:
Finally, there is a state transfer diagram for thread M:
(Note: The above pictures are from the public number [code farmer peach blossom source], Rao Da painting is too good, directly let people do not want to paint. Very good public number, full of dry goods, logical, clear, and occasionally witty humor, recommended oh.)
2. GPM
2.1 GPM Workflow
Straight to the picture:
(This image is from senior Gopher Cao Da, whose site is athere areRecommended.)
2.2 Scheduling process
Click here to see ->Dynamic Demonstration Chart
(This image and animation is also from Cao Da Haha)
3. Summary
This is basically the end of the Go runtime scheduler presentation, I hope you have learned something from these lectures, thanks for your company, see you soon.
4. References
- go language scheduler source code scenario analysis
- The Go scheduler
- Go Wiki: Debugging performance issues in Go programs
- goroutine scheduler
- Advanced Programming in Go