From 10dcd591a65368961912f4b5ea1bd932061eb262 Mon Sep 17 00:00:00 2001 From: tohti bilikyar Date: Wed, 31 Jul 2019 17:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/c12/p12_using_generators_as_alternative_to_threads.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/c12/p12_using_generators_as_alternative_to_threads.rst b/source/c12/p12_using_generators_as_alternative_to_threads.rst index 94b8ffc..6a91231 100644 --- a/source/c12/p12_using_generators_as_alternative_to_threads.rst +++ b/source/c12/p12_using_generators_as_alternative_to_threads.rst @@ -385,7 +385,7 @@ 最后,如果使用生成器编程,要提醒你的是它还是有很多缺点的。 特别是,你得不到任何线程可以提供的好处。例如,如果你执行CPU依赖或I/O阻塞程序, -它会将整个任务挂起知道操作完成。为了解决这个问题, +它会将整个任务挂起直到操作完成。为了解决这个问题, 你只能选择将操作委派给另外一个可以独立运行的线程或进程。 另外一个限制是大部分Python库并不能很好的兼容基于生成器的线程。 如果你选择这个方案,你会发现你需要自己改写很多标准库函数。