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

modify typo #53

Open
wants to merge 1 commit into
base: master
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 content/42_21_goroutine.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## 21.1 并发

并发是在同一时间处理多件事情。并行是在同一时间做多件事情。并发的目的在于把当个 CPU 的利用率使用到最高。并行则需要多核 CPU 的支持。
并发是在同一时间处理多件事情。并行是在同一时间做多件事情。并发的目的在于把单个 CPU 的利用率使用到最高。并行则需要多核 CPU 的支持。

Go 语言在语言层面上支持了并发,goroutine是Go语言提供的一种用户态线程,有时我们也称之为协程。所谓的协程,某种程度上也可以叫做轻量线程,它不由系统而由应用程序创建和管理,因此使用开销较低(一般为4K)。我们可以创建很多的协程,并且它们跑在同一个内核线程之上的时候,就需要一个调度器来维护这些协程,确保所有的协程都能使用CPU,并且是尽可能公平地使用CPU资源。

Expand Down