Skip to main content

Python asyncio

📅 2026-02-05 ✏️ 2026-03-16 CS Python
No related notes

1 · Python asyncio库#

1.1 · 基本概念

https://docs.python.org/3/library/asyncio.html 标准库,提供api运行管理 coroutine

asyncio is a library to write concurrent code using the async/await syntax.

1.1.1 · 什么是concurrent code#

1.1.2 · 什么是async/await语法#

1.2 · 执行模型

cooperative multitasking 协作式多任务:协程被调度并发执行

1.3 · 深入理解

https://bbc.github.io/cloudfit-public-docs/asyncio/asyncio-part-1.html

https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/

https://lotabout.github.io/2017/understand-python-asyncio/

https://realpython.com/python-concurrency/ https://realpython.com/async-io-python/#the-10000-foot-view-of-async-io