Files
cs-note/hzh/GolangStar/Go语言原理/gmp调度原理.md
T

23 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
tags: [go, golang, go-principle, gmp-scheduler]
create time: 2026-06-07 15:50
---
# GMP 调度原理
## 概述
本文从宏观架构到微观源码,全方位解析 Go 的 GMP 调度模型。由于内容较长,已拆分为以下子文档,建议按顺序阅读。
---
### 阅读顺序
| # | 文档 | 涵盖内容 | 适合阶段 |
|---|------|----------|----------|
| 1 | [[hzh/GolangStar/Go语言原理/gmp调度原理/gmp-overview]] | G/M/P 角色、LRQ/GRQ 队列、work-stealing、GMP 生态圈 | 入门建立全局视图 |
| 2 | [[hzh/GolangStar/Go语言原理/gmp调度原理/gmp-datastructures]] | G/M/P/schedt 结构体源码逐字段解析 + 状态机 | 深入理解底层布局 |
| 3 | [[hzh/GolangStar/Go语言原理/gmp调度原理/gmp-lifecycle]] | goroutine 创建流程 → findRunnable 调度 → 三种让渡方式(结束/Gosched/gopark) | 追踪完整生命周期 |
| 4 | [[hzh/GolangStar/Go语言原理/gmp调度原理/gmp-preemption]] | sysmon 线程、系统调用抢占、协作式与非协作式抢占 | 理解强制干预机制 |
| 5 | [[hzh/GolangStar/Go语言原理/gmp调度原理/gmp-summary]] | 全景流程图 + 核心要点速查表 | 复习回顾 / 面试准备 |