Skip to content

Commit

Permalink
modify typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ldwangaqr committed Jun 4, 2024
1 parent 710fce1 commit 33fe36f
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 33fe36f

Please sign in to comment.