# 11.1 并行和并发模型

CPython 提供了许多并行和并发的方法。选择哪个取决于多个因素。随着 CPython 的发展，模型之间也存在重叠的用例。

你可能会发现，对于特定的问题，有多种并发实现可供选择，每一种都各有利弊。

CPython 捆绑了四种模型：

| 方法   | 模块                | 并发 | 并行 |
| ---- | ----------------- | -- | -- |
| 线程   | `threading`       | 是  | 否  |
| 多进程  | `multiprocessing` | 是  | 是  |
| 异步   | `asyncio`         | 是  | 否  |
| 子解释器 | `subinterpreters` | 是  | 是  |


---

# 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://hai-shi.gitbook.io/cpython-internals/11-parall-concur/11.1-models-of-parallelism-and-concurrency.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.
