Skip to content

Commit 0325737

Browse files
committed
Go 1.14 调度调整
1 parent 955d90d commit 0325737

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

appendix/appendix-a-trap.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func main() {
146146

147147
## 独占CPU导致其它Goroutine饿死
148148

149-
Goroutine是协作式抢占调度,Goroutine本身不会主动放弃CPU:
149+
Goroutine 是协作式抢占调度(Go1.14版本之前),Goroutine本身不会主动放弃CPU:
150150

151151
```go
152152
func main() {
@@ -197,6 +197,8 @@ func main() {
197197
}
198198
```
199199

200+
Go1.14 版本引入基于系统信号的异步抢占调度,可以避免 Goroutine 饿死的情况。
201+
200202
## 不同Goroutine之间不满足顺序一致性内存模型
201203

202204
因为在不同的Goroutine,main函数中无法保证能打印出`hello, world`:

0 commit comments

Comments
 (0)