@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version :Python 3.11\n "
1313"Report-Msgid-Bugs-To :\n "
14- "POT-Creation-Date :2025-01-03 15:28 +0000\n "
14+ "POT-Creation-Date :2025-09-22 20:37 +0000\n "
1515"PO-Revision-Date :2025-09-22 16:50+0000\n "
1616"Last-Translator :python-doc bot, 2025\n "
1717"Language-Team :Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -56,6 +56,10 @@ msgid ""
5656"module allows the programmer to fully leverage multiple processors on a "
5757"given machine. It runs on both Unix and Windows."
5858msgstr ""
59+ ":mod:`multiprocessing` 是一个支持使用与 :mod:`threading` 模块类似的 API 来产生进程的包。 "
60+ ":mod:`multiprocessing` 包同时提供了本地和远程并发操作,通过使用子进程而非线程有效地绕过了 :term:`全局解释器锁 "
61+ "<global interpreter lock>`。 因此,:mod:`multiprocessing` "
62+ "模块允许程序员充分利用给定机器上的多个处理器。 它在 Unix 和 Windows 上均可运行。"
5963
6064#: ../../library/multiprocessing.rst:25
6165msgid ""
@@ -148,7 +152,7 @@ msgstr ""
148152
149153#: ../../library/multiprocessing.rst:118
150154msgid "Available on Unix and Windows. The default on Windows and macOS."
151- msgstr ""
155+ msgstr "可在 Unix 和 Windows 上使用。 Windows 和 macOS 上的默认设置。 "
152156
153157#: ../../library/multiprocessing.rst:127
154158msgid "*fork*"
@@ -166,7 +170,7 @@ msgstr ""
166170
167171#: ../../library/multiprocessing.rst:127
168172msgid "Available on Unix only. The default on Unix."
169- msgstr ""
173+ msgstr "只存在于 Unix。 Unix 中的默认值。 "
170174
171175#: ../../library/multiprocessing.rst:138
172176msgid "*forkserver*"
@@ -180,12 +184,14 @@ msgid ""
180184"process. The fork server process is single threaded so it is safe for it to"
181185" use :func:`os.fork`. No unnecessary resources are inherited."
182186msgstr ""
187+ "程序启动并选择 *forkserver* 启动方法时,将启动服务器进程。 从那时起,每当需要一个新进程时,父进程就会连接到服务器并请求它分叉一个新进程。"
188+ " 分叉服务器进程是单线程的,因此使用 :func:`os.fork` 是安全的。 没有不必要的资源被继承。"
183189
184190#: ../../library/multiprocessing.rst:137
185191msgid ""
186192"Available on Unix platforms which support passing file descriptors over Unix"
187193" pipes."
188- msgstr ""
194+ msgstr "可在Unix平台上使用,支持通过Unix管道传递文件描述符。 "
189195
190196#: ../../library/multiprocessing.rst:140
191197msgid ""
@@ -271,6 +277,8 @@ msgid ""
271277"**PyInstaller** and **cx_Freeze**) on Unix. The ``'fork'`` start method does"
272278" work."
273279msgstr ""
280+ "``'spawn'`` 和 ``'forkserver'`` 启动方法当前不能在Unix上和“冻结的”可执行内容一同使用(例如,有类似 "
281+ "**PyInstaller** 和 **cx_Freeze** 的包产生的二进制文件)。 ``'fork'`` 启动方法可以使用。"
274282
275283#: ../../library/multiprocessing.rst:221
276284msgid "Exchanging objects between processes"
@@ -714,6 +722,9 @@ msgid ""
714722" ``WaitForMultipleObjects`` family of API calls. On Unix, this is a file "
715723"descriptor usable with primitives from the :mod:`select` module."
716724msgstr ""
725+ "在Windows上,这是一个操作系统句柄,可以与 ``WaitForSingleObject`` 和 "
726+ "``WaitForMultipleObjects`` 系列API调用一起使用。在Unix上,这是一个文件描述符,可以使用来自 :mod:`select`"
727+ " 模块的原语。"
717728
718729#: ../../library/multiprocessing.rst:639
719730msgid ""
@@ -743,7 +754,7 @@ msgstr ""
743754
744755#: ../../library/multiprocessing.rst:656
745756msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix."
746- msgstr ""
757+ msgstr "与 :meth:`terminate()` 相同,但在Unix上使用 ``SIGKILL`` 信号。 "
747758
748759#: ../../library/multiprocessing.rst:662
749760msgid ""
@@ -975,6 +986,8 @@ msgid ""
975986"Note that this may raise :exc:`NotImplementedError` on Unix platforms like "
976987"macOS where ``sem_getvalue()`` is not implemented."
977988msgstr ""
989+ "请注意,这可能会在Unix平台上引起 :exc:`NotImplementedError` ,如 macOS ,因为其上没有实现 "
990+ "``sem_getvalue()`` 。"
978991
979992#: ../../library/multiprocessing.rst:823
980993msgid ""
@@ -1273,6 +1286,9 @@ msgid ""
12731286"``'fork'`` and ``'spawn'`` are always supported, with ``'fork'`` being the "
12741287"default."
12751288msgstr ""
1289+ "返回支持的启动方法的列表,该列表的首项即为默认选项。可能的启动方法有 ``'fork'`` , ``'spawn'`` "
1290+ "和``'forkserver'`` 。在 Windows 中,只有 ``'spawn'`` 是可用的。 Unix 平台总是支持 ``'fork'`` "
1291+ "和 ``'spawn'`` ,且 ``'fork'`` 是默认值。 "
12761292
12771293#: ../../library/multiprocessing.rst:1045
12781294msgid ""
@@ -1286,6 +1302,8 @@ msgid ""
12861302"*method* should be ``'fork'``, ``'spawn'``, ``'forkserver'``. "
12871303":exc:`ValueError` is raised if the specified start method is not available."
12881304msgstr ""
1305+ "如果 *method* 设置成 ``None`` 那么将返回默认上下文对象。否则 *method* 应该是 ``'fork'``, "
1306+ "``'spawn'``, ``'forkserver'`` 。 如果指定的启动方法不存在,将抛出 :exc:`ValueError` 异常。 "
12891307
12901308#: ../../library/multiprocessing.rst:1057
12911309msgid "Return the name of start method used for starting processes."
@@ -1308,6 +1326,8 @@ msgid ""
13081326"``None``. ``'fork'`` is the default on Unix, while ``'spawn'`` is the "
13091327"default on Windows and macOS."
13101328msgstr ""
1329+ "返回值将为 ``'fork'`` , ``'spawn'`` , ``'forkserver'`` 或者 ``None`` 。 "
1330+ "``'fork'`` 是 Unix 的默认值, ``'spawn'`` 是 Windows 和 macOS 的默认值。"
13111331
13121332#: ../../library/multiprocessing.rst:1072
13131333msgid ""
@@ -1332,7 +1352,7 @@ msgstr "以使他们可以创建子进程。"
13321352
13331353#: ../../library/multiprocessing.rst:1086
13341354msgid "Now supported on Unix when the ``'spawn'`` start method is used."
1335- msgstr ""
1355+ msgstr "现在在 Unix 平台上使用 ``'spawn'`` 启动方法时支持调用该方法。 "
13361356
13371357#: ../../library/multiprocessing.rst:1089
13381358msgid "Accepts a :term:`path-like object`."
@@ -3180,7 +3200,7 @@ msgstr ""
31803200#: ../../library/multiprocessing.rst:2522
31813201msgid ""
31823202"For both Unix and Windows, an object can appear in *object_list* if it is"
3183- msgstr ""
3203+ msgstr "对于 Unix 和 Windows ,满足下列条件的对象可以出现在 *object_list* 中 "
31843204
31853205#: ../../library/multiprocessing.rst:2525
31863206msgid "a readable :class:`~multiprocessing.connection.Connection` object;"
@@ -3212,6 +3232,9 @@ msgid ""
32123232":exc:`OSError` with an error number of ``EINTR``, whereas :func:`wait` will "
32133233"not."
32143234msgstr ""
3235+ "**Unix**: ``wait(object_list, timeout)`` 和 ``select.select(object_list, [], "
3236+ "[], timeout)`` 几乎相同。差别在于,如果 :func:`select.select` 被信号中断,它会抛出一个附带错误号为 "
3237+ "``EINTR`` 的 :exc:`OSError` 异常,而 :func:`wait` 不会。"
32153238
32163239#: ../../library/multiprocessing.rst:2539
32173240msgid ""
@@ -3535,6 +3558,11 @@ msgid ""
35353558"join the process. Even so it is probably good practice to explicitly join "
35363559"all the processes that you start."
35373560msgstr ""
3561+ "在 Unix 上,如果一个进程执行完成但是没有被 join,就会变成僵尸进程。一般来说,僵尸进程不会很多,因为每次新启动进程(或者 "
3562+ ":func:`~multiprocessing.active_children` 被调用)时,所有已执行完成且没有被 join 的进程都会自动被 "
3563+ "join,而且对一个执行完的进程调用 :meth:`Process.is_alive "
3564+ "<multiprocessing.Process.is_alive>` 也会 join 这个进程。尽管如此,对自己启动的进程显式调用 join "
3565+ "依然是最佳实践。"
35383566
35393567#: ../../library/multiprocessing.rst:2813
35403568msgid "Better to inherit than pickle/unpickle"
@@ -3623,6 +3651,7 @@ msgid ""
36233651"However, it is better to pass the object as an argument to the constructor "
36243652"for the child process."
36253653msgstr ""
3654+ "在Unix上,使用 *fork* 方式启动的子进程可以使用父进程中全局创建的共享资源。不过,最好是显式将资源对象通过参数的形式传递给子进程。"
36263655
36273656#: ../../library/multiprocessing.rst:2873
36283657msgid ""