- 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.
- Containerization with LXC
- Implementing Cisco UCS Solutions
- 無(wú)蘋(píng)果不生活 OS X Mountain Lion隨身寶典
- WordPress Mobile Web Development:Beginner's Guide
- Windows Phone 7.5 Data Cookbook
- 新手易學(xué):系統(tǒng)安裝與重裝
- Linux集群和自動(dòng)化運(yùn)維
- 新手學(xué)電腦從入門(mén)到精通(Windows 10+Office 2016版)
- macOS效率手冊(cè)
- Ceph分布式存儲(chǔ)實(shí)戰(zhàn)
- ElasticSearch Cookbook
- Advanced TypeScript Programming Projects
- 計(jì)算機(jī)系統(tǒng)的自主設(shè)計(jì)
- VMware Horizon View Essentials
- HTML5 Enterprise Application Development