> For the complete documentation index, see [llms.txt](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wskdsgcf.gitbook.io/mastering-go-zh-cn/10.0.md).

# 10 Go 并发-进阶讨论

上一章介绍了 goroutines——Go 中最重要的特性，channels 和 pipelines。这章在讨论共享变量，`sync.Mutex` 和 `sync.RWMutex` 类型前，将继续从上章留下的这点出发来了解更多关于 goroutines，channels 和 `select` 关键字。这章也包括一些代码示例用于说明信号 channels，缓冲 channels，空 channels 和 channels 的 channels 的使用。另外，这章的前期您将了解俩个技巧用于一个 goroutine 在给定时间后的超时处理，因为没人能保证所有的 goroutines 能在期望的时间前都完成。这章将以检查竞争条件，`context` 标准包和工作池来结束。

在*玩转 Go* 的本章中，您将了解到如下主题：

* `select` 关键字
* Go 调度器如何工作
* 俩个技巧用于一个完成时长超过预期的 goroutine 的超时处理
* 信号 channels
* 缓冲 channels
* 空 channels
* 监控 goroutines
* channels 的 channels
* 共享内存和互斥器
* `sync.Mutex` 和 `sync.RWMutex` 类型
* `contenxt` 包和它的功能
* 工作池
* 探测竞争条件
