- Distributed Computing with Go
- V.N. Nikhil Anurag
- 156字
- 2021-06-24 18:36:11
Go's runtime scheduler
The Go program, along with the runtime, is managed and executed on multiple OS threads. The runtime uses a scheduler strategy known as M:N scheduler, which will schedule M number of goroutines on N number of OS threads. As a result, whenever we need to run or switch to a different goroutine, the context switching will be fast, and this also enables us to use multiple cores of the CPU for parallel computing.
A solid understanding of Go's runtime and scheduler would be quite interesting and useful, and now would be a good time to look at them in detail.
From the Go scheduler's perspective, there are primarily three entities:
- Goroutine (G)
- OS thread or machine (M)
- Context or processor (P)
Let's look at what they do. We will also be looking the partial struct definitions of these entities to provide a better idea of how scheduling is implemented and how it works.
- Linux設備驅動開發詳解(第2版)
- Ansible權威指南
- Mastering Distributed Tracing
- 嵌入式Linux系統開發:基于Yocto Project
- Windows Vista融會貫通
- Kali Linux 2018:Windows Penetration Testing
- 從實踐中學習Kali Linux無線網絡滲透測試
- Linux內核API完全參考手冊(第2版)
- 大學計算機應用基礎實踐教程(Windows 7+MS Office 2010)
- Getting Started with UDK
- Less Web Development Essentials
- Responsive Web Design with AngularJS
- Administering ArcGIS for Server
- 鴻蒙操作系統開發入門經典
- UG NX 實例教程(第2版)