# 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` 包和它的功能
* 工作池
* 探测竞争条件


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wskdsgcf.gitbook.io/mastering-go-zh-cn/10.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
