File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
- Overview
2
- ------
1
+ # Overview
3
2
4
3
主要是源码分析,可能也会有一些使用上的知识点。
5
4
6
5
因为用了 stackedit 支持的 mermaid 图表,这些图表在 github 上显示不出来,如果想看完整内容的话,可以在 stackedit.io 上导出为 html。
7
6
8
-
9
7
1 . [x] Bootstrap
10
8
2 . [x] Channel
11
9
3 . [ ] Interface
@@ -18,7 +16,7 @@ Overview
18
16
10 . [ ] Reflect
19
17
11 . [ ] Panic
20
18
12 . [ ] Goroutine
21
- 13 . [ ] Scheduler
19
+ 13 . [x ] Scheduler
22
20
14 . [ ] GC
23
21
15 . [x] Assembly
24
22
16 . [ ] Map
Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ func sysmon() {
825
825
}
826
826
```
827
827
828
- checkdead:
828
+ #### checkdead
829
829
830
830
``` go
831
831
// 检查死锁的场景
@@ -904,7 +904,7 @@ func checkdead() {
904
904
}
905
905
```
906
906
907
- retake:
907
+ #### retake
908
908
909
909
``` go
910
910
// forcePreemptNS is the time slice given to a G before it is
@@ -1191,6 +1191,14 @@ goexit1 --> goexit0
1191
1191
goexit0 --> schedule
1192
1192
```
1193
1193
1194
+ #### gogo
1195
+
1196
+ TODO
1197
+
1198
+ #### execute
1199
+
1200
+ TODO
1201
+
1194
1202
#### findrunnable
1195
1203
1196
1204
findrunnable 比较复杂,流程图先把 gc 相关的省略掉了:
@@ -1443,7 +1451,7 @@ stop:
1443
1451
1444
1452
## m 和 p 解绑定
1445
1453
1446
- handoffp:
1454
+ ### handoffp
1447
1455
1448
1456
``` mermaid
1449
1457
graph TD
@@ -1464,6 +1472,8 @@ entersyscallblock_handoff --> handoffp
1464
1472
retake --> |p status == syscall| handoffp
1465
1473
```
1466
1474
1475
+ TODO 代码说明
1476
+
1467
1477
## g 的状态迁移
1468
1478
1469
1479
``` mermaid
You can’t perform that action at this time.
0 commit comments