- Distributed Computing with Go
- V.N. Nikhil Anurag
- 143字
- 2021-06-24 18:36:11
OS thread or machine
Initially, the OS threads or machines are created by and managed by the OS. Later on, the scheduler can request for more OS threads or machines to be created or destroyed. It is the actual resource upon which a goroutine will be executed. It also maintains information about the main goroutine, the G currently being run on it, thread local storage (tls), and so on:
// Denoted as M in runtime type m struct { g0 *g // goroutine with scheduling stack tls [6]uintptr // thread-local storage (for x86 extern register) curg *g // current running goroutine p puintptr // attached p for executing go code (nil if not executing go code) id int32 createstack [32]uintptr // stack that created this thread. spinning bool // m is out of work and is actively looking for work // ... }
推薦閱讀
- Linux設備驅動開發詳解:基于最新的Linux4.0內核
- 零起點學Linux系統管理
- 大學計算機應用基礎實踐教程(Windows 7+Office 2013)
- 白話區塊鏈
- SOA實踐者說
- Implementing Azure DevOps Solutions
- Windows Phone應用程序開發
- 嵌入式實時操作系統μC/OS原理與實踐
- 巧學活用Windows 7
- 細說Linux基礎知識
- Kali Linux 2018:Windows Penetration Testing
- Delphi Programming Projects
- 深入淺出Node.js
- OpenSolaris設備驅動原理與開發
- Linux內核API完全參考手冊(第2版)