@@ -195,6 +195,9 @@ msgid ""
195195":class:`MultiLoopChildWatcher`, :class:`SafeChildWatcher`, and "
196196":class:`FastChildWatcher`."
197197msgstr ""
198+ "asyncio 定义了 :class:`AbstractChildWatcher` 抽象基类,子监视器必须要实现它,并具有四种不同实现: "
199+ ":class:`ThreadedChildWatcher` (已配置为默认使用), :class:`MultiLoopChildWatcher`, "
200+ ":class:`SafeChildWatcher` 和 :class:`FastChildWatcher`。"
198201
199202#: ../../library/asyncio-policy.rst:139
200203msgid ""
@@ -271,13 +274,13 @@ msgstr "注意:循环有可能是 ``None`` 。"
271274
272275#: ../../library/asyncio-policy.rst:191
273276msgid "Return ``True`` if the watcher is ready to use."
274- msgstr ""
277+ msgstr "如果监视器已准备好使用则返回 ``True``。 "
275278
276279#: ../../library/asyncio-policy.rst:193
277280msgid ""
278281"Spawning a subprocess with *inactive* current child watcher raises "
279282":exc:`RuntimeError`."
280- msgstr ""
283+ msgstr "使用 *不活动的* 当前子监视器生成子进程将引发 :exc:`RuntimeError`。 "
281284
282285#: ../../library/asyncio-policy.rst:200
283286msgid "Close the watcher."
@@ -292,56 +295,60 @@ msgstr "必须调用这个方法以确保相关资源会被清理。"
292295#: ../../library/asyncio-policy.rst:207
293296msgid ""
294297"This implementation starts a new waiting thread for every subprocess spawn."
295- msgstr ""
298+ msgstr "此实现会为每个生成的子进程启动一具新的等待线程。 "
296299
297300#: ../../library/asyncio-policy.rst:209
298301msgid ""
299302"It works reliably even when the asyncio event loop is run in a non-main OS "
300303"thread."
301- msgstr ""
304+ msgstr "即使是当 asyncio 事件循环运行在非主 OS 线程上时它也能可靠地工作。 "
302305
303306#: ../../library/asyncio-policy.rst:211
304307msgid ""
305308"There is no noticeable overhead when handling a big number of children "
306309"(*O(1)* each time a child terminates), but stating a thread per process "
307310"requires extra memory."
308- msgstr ""
311+ msgstr "当处理大量子进程时也不存在显著的开销 (每个子进程结束时为 *O(1)*) ,但当每个进程启动线程时则需要额外的内存。 "
309312
310313#: ../../library/asyncio-policy.rst:214
311314msgid "This watcher is used by default."
312- msgstr ""
315+ msgstr "此监视器会默认被使用。 "
313316
314317#: ../../library/asyncio-policy.rst:220
315318msgid ""
316319"This implementation registers a :py:data:`SIGCHLD` signal handler on "
317320"instantiation. That can break third-party code that installs a custom "
318321"handler for `SIGCHLD`. signal)."
319322msgstr ""
323+ "此实现会在实例化时注册一个 :py:data:`SIGCHLD` 信号处理程序。 这可能会破坏为 `SIGCHLD` "
324+ "信号安装了自定义信号处理程序的第三方代码。"
320325
321326#: ../../library/asyncio-policy.rst:224 ../../library/asyncio-policy.rst:242
322327msgid ""
323328"The watcher avoids disrupting other code spawning processes by polling every"
324329" process explicitly on a :py:data:`SIGCHLD` signal."
325- msgstr ""
330+ msgstr "此监视器会在收到 :py:data:`SIGCHLD` 信号时通过显式地轮询每个进程来避免干扰其他代码生成的进程。 "
326331
327332#: ../../library/asyncio-policy.rst:227
328333msgid ""
329334"There is no limitation for running subprocesses from different threads once "
330335"the watcher is installed."
331- msgstr ""
336+ msgstr "该监视器一旦被安装就不会限制从不同线程运行子进程。 "
332337
333338#: ../../library/asyncio-policy.rst:230
334339msgid ""
335340"The solution is safe but it has a significant overhead when handling a big "
336341"number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)."
337- msgstr ""
342+ msgstr "该解决方案是安全的,但在处理大量进程时会有显著的开销 (每收到一个 :py:data:`SIGCHLD` 时为 *O(n)*)。 "
338343
339344#: ../../library/asyncio-policy.rst:238
340345msgid ""
341346"This implementation uses active event loop from the main thread to handle "
342347":py:data:`SIGCHLD` signal. If the main thread has no running event loop "
343348"another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)."
344349msgstr ""
350+ "该实现会使用主线程中的活动事件循环来处理 :py:data:`SIGCHLD` 信号。 如果主线程没有正在运行的事件循环,则其他线程无法生成子进程 "
351+ "(会引发 :exc:`RuntimeError`)。"
345352
346353#: ../../library/asyncio-policy.rst:245
347354msgid ""
0 commit comments