Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 修复runtime/mpg 一些语言问题,使阅读更顺畅 #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/zh-cn/part2runtime/ch06sched/mpg.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ P 的存在不太好理解,我们暂时先记住这个概念,之后再来回
每个 M 在某个时刻有且只能调度一个 G。根据抽屉原理,可以很容易的证明这两条性质:

- 性质 1:当用户态代码创建了 $p (p > n)$ 个 G 时,则必定存在 $p-n$ 个 G 尚未被 M 调度执行;
- 性质 2:当用户态代码创建的 q (q < n) 时,则必定存在 n-q 个 M 不存在正在调度的 G。
- 性质 2:当用户态代码创建的 $q (q < n)$ 个 G 时,则必定存在 $n-q$ 个 M 不存在正在调度的 G。

这两条性质分别决定了工作线程的 **暂止(park)** 和 **复始(unpark)** 。

Expand Down