- 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.
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Linux Mint Essentials
- FreeRTOS實時內核應用指南
- 嵌入式實時操作系統μC/OS原理與實踐
- jQuery UI Cookbook
- Mastering Windows 8 C++ App Development
- Raspberry Pi入門指南
- OpenStack Essentials(Second Edition)
- Implementing Domain-Specific Languages with Xtext and Xtend(Second Edition)
- 再也不踩坑的kubernetes實戰指南
- Mastering Eclipse Plug-in Development
- 物聯網操作系統AliOS Things探索與實踐
- Modern Python Cookbook
- VMware Virtual SAN Cookbook
- Linux指令從入門到精通(“十二五”國家重點圖書出版規劃項目)