We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b9d509f + fe1d0e8 commit 92751abCopy full SHA for 92751ab
2、Golang的协程调度器原理及GMP设计思想?.md
@@ -544,7 +544,7 @@ G2创建G8时,P1的本地队列未满,所以G8会被加入到P1的本地队
544
M2尝试从全局队列(简称“GQ”)取一批G放到P2的本地队列(函数:`findrunnable()`)。M2从全局队列取的G数量符合下面的公式:
545
546
```go
547
-n = min(len(GQ)/GOMAXPROCS + 1, len(GQ/2))
+n = min(len(GQ)/GOMAXPROCS + 1, len(GQ)/2)
548
```
549
550
至少从全局队列取1个g,但每次不要从全局队列移动太多的g到p本地队列,给其他p留点。这是**从全局队列到P本地队列的负载均衡**。
0 commit comments