@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.11\n "
13
13
"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 "
15
15
"PO-Revision-Date : 2025-09-22 16:50+0000\n "
16
16
"Last-Translator : python-doc bot, 2025\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -56,6 +56,10 @@ msgid ""
56
56
"module allows the programmer to fully leverage multiple processors on a "
57
57
"given machine. It runs on both Unix and Windows."
58
58
msgstr ""
59
+ ":mod:`multiprocessing` 是一个支持使用与 :mod:`threading` 模块类似的 API 来产生进程的包。 "
60
+ ":mod:`multiprocessing` 包同时提供了本地和远程并发操作,通过使用子进程而非线程有效地绕过了 :term:`全局解释器锁 "
61
+ "<global interpreter lock>`。 因此,:mod:`multiprocessing` "
62
+ "模块允许程序员充分利用给定机器上的多个处理器。 它在 Unix 和 Windows 上均可运行。"
59
63
60
64
#: ../../library/multiprocessing.rst:25
61
65
msgid ""
@@ -148,7 +152,7 @@ msgstr ""
148
152
149
153
#: ../../library/multiprocessing.rst:118
150
154
msgid "Available on Unix and Windows. The default on Windows and macOS."
151
- msgstr ""
155
+ msgstr "可在 Unix 和 Windows 上使用。 Windows 和 macOS 上的默认设置。 "
152
156
153
157
#: ../../library/multiprocessing.rst:127
154
158
msgid "*fork*"
@@ -166,7 +170,7 @@ msgstr ""
166
170
167
171
#: ../../library/multiprocessing.rst:127
168
172
msgid "Available on Unix only. The default on Unix."
169
- msgstr ""
173
+ msgstr "只存在于 Unix。 Unix 中的默认值。 "
170
174
171
175
#: ../../library/multiprocessing.rst:138
172
176
msgid "*forkserver*"
@@ -180,12 +184,14 @@ msgid ""
180
184
"process. The fork server process is single threaded so it is safe for it to"
181
185
" use :func:`os.fork`. No unnecessary resources are inherited."
182
186
msgstr ""
187
+ "程序启动并选择 *forkserver* 启动方法时,将启动服务器进程。 从那时起,每当需要一个新进程时,父进程就会连接到服务器并请求它分叉一个新进程。"
188
+ " 分叉服务器进程是单线程的,因此使用 :func:`os.fork` 是安全的。 没有不必要的资源被继承。"
183
189
184
190
#: ../../library/multiprocessing.rst:137
185
191
msgid ""
186
192
"Available on Unix platforms which support passing file descriptors over Unix"
187
193
" pipes."
188
- msgstr ""
194
+ msgstr "可在Unix平台上使用,支持通过Unix管道传递文件描述符。 "
189
195
190
196
#: ../../library/multiprocessing.rst:140
191
197
msgid ""
@@ -271,6 +277,8 @@ msgid ""
271
277
"**PyInstaller** and **cx_Freeze**) on Unix. The ``'fork'`` start method does"
272
278
" work."
273
279
msgstr ""
280
+ "``'spawn'`` 和 ``'forkserver'`` 启动方法当前不能在Unix上和“冻结的”可执行内容一同使用(例如,有类似 "
281
+ "**PyInstaller** 和 **cx_Freeze** 的包产生的二进制文件)。 ``'fork'`` 启动方法可以使用。"
274
282
275
283
#: ../../library/multiprocessing.rst:221
276
284
msgid "Exchanging objects between processes"
@@ -714,6 +722,9 @@ msgid ""
714
722
" ``WaitForMultipleObjects`` family of API calls. On Unix, this is a file "
715
723
"descriptor usable with primitives from the :mod:`select` module."
716
724
msgstr ""
725
+ "在Windows上,这是一个操作系统句柄,可以与 ``WaitForSingleObject`` 和 "
726
+ "``WaitForMultipleObjects`` 系列API调用一起使用。在Unix上,这是一个文件描述符,可以使用来自 :mod:`select`"
727
+ " 模块的原语。"
717
728
718
729
#: ../../library/multiprocessing.rst:639
719
730
msgid ""
@@ -743,7 +754,7 @@ msgstr ""
743
754
744
755
#: ../../library/multiprocessing.rst:656
745
756
msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix."
746
- msgstr ""
757
+ msgstr "与 :meth:`terminate()` 相同,但在Unix上使用 ``SIGKILL`` 信号。 "
747
758
748
759
#: ../../library/multiprocessing.rst:662
749
760
msgid ""
@@ -975,6 +986,8 @@ msgid ""
975
986
"Note that this may raise :exc:`NotImplementedError` on Unix platforms like "
976
987
"macOS where ``sem_getvalue()`` is not implemented."
977
988
msgstr ""
989
+ "请注意,这可能会在Unix平台上引起 :exc:`NotImplementedError` ,如 macOS ,因为其上没有实现 "
990
+ "``sem_getvalue()`` 。"
978
991
979
992
#: ../../library/multiprocessing.rst:823
980
993
msgid ""
@@ -1273,6 +1286,9 @@ msgid ""
1273
1286
"``'fork'`` and ``'spawn'`` are always supported, with ``'fork'`` being the "
1274
1287
"default."
1275
1288
msgstr ""
1289
+ "返回支持的启动方法的列表,该列表的首项即为默认选项。可能的启动方法有 ``'fork'`` , ``'spawn'`` "
1290
+ "和``'forkserver'`` 。在 Windows 中,只有 ``'spawn'`` 是可用的。 Unix 平台总是支持 ``'fork'`` "
1291
+ "和 ``'spawn'`` ,且 ``'fork'`` 是默认值。 "
1276
1292
1277
1293
#: ../../library/multiprocessing.rst:1045
1278
1294
msgid ""
@@ -1286,6 +1302,8 @@ msgid ""
1286
1302
"*method* should be ``'fork'``, ``'spawn'``, ``'forkserver'``. "
1287
1303
":exc:`ValueError` is raised if the specified start method is not available."
1288
1304
msgstr ""
1305
+ "如果 *method* 设置成 ``None`` 那么将返回默认上下文对象。否则 *method* 应该是 ``'fork'``, "
1306
+ "``'spawn'``, ``'forkserver'`` 。 如果指定的启动方法不存在,将抛出 :exc:`ValueError` 异常。 "
1289
1307
1290
1308
#: ../../library/multiprocessing.rst:1057
1291
1309
msgid "Return the name of start method used for starting processes."
@@ -1308,6 +1326,8 @@ msgid ""
1308
1326
"``None``. ``'fork'`` is the default on Unix, while ``'spawn'`` is the "
1309
1327
"default on Windows and macOS."
1310
1328
msgstr ""
1329
+ "返回值将为 ``'fork'`` , ``'spawn'`` , ``'forkserver'`` 或者 ``None`` 。 "
1330
+ "``'fork'`` 是 Unix 的默认值, ``'spawn'`` 是 Windows 和 macOS 的默认值。"
1311
1331
1312
1332
#: ../../library/multiprocessing.rst:1072
1313
1333
msgid ""
@@ -1332,7 +1352,7 @@ msgstr "以使他们可以创建子进程。"
1332
1352
1333
1353
#: ../../library/multiprocessing.rst:1086
1334
1354
msgid "Now supported on Unix when the ``'spawn'`` start method is used."
1335
- msgstr ""
1355
+ msgstr "现在在 Unix 平台上使用 ``'spawn'`` 启动方法时支持调用该方法。 "
1336
1356
1337
1357
#: ../../library/multiprocessing.rst:1089
1338
1358
msgid "Accepts a :term:`path-like object`."
@@ -3180,7 +3200,7 @@ msgstr ""
3180
3200
#: ../../library/multiprocessing.rst:2522
3181
3201
msgid ""
3182
3202
"For both Unix and Windows, an object can appear in *object_list* if it is"
3183
- msgstr ""
3203
+ msgstr "对于 Unix 和 Windows ,满足下列条件的对象可以出现在 *object_list* 中 "
3184
3204
3185
3205
#: ../../library/multiprocessing.rst:2525
3186
3206
msgid "a readable :class:`~multiprocessing.connection.Connection` object;"
@@ -3212,6 +3232,9 @@ msgid ""
3212
3232
":exc:`OSError` with an error number of ``EINTR``, whereas :func:`wait` will "
3213
3233
"not."
3214
3234
msgstr ""
3235
+ "**Unix**: ``wait(object_list, timeout)`` 和 ``select.select(object_list, [], "
3236
+ "[], timeout)`` 几乎相同。差别在于,如果 :func:`select.select` 被信号中断,它会抛出一个附带错误号为 "
3237
+ "``EINTR`` 的 :exc:`OSError` 异常,而 :func:`wait` 不会。"
3215
3238
3216
3239
#: ../../library/multiprocessing.rst:2539
3217
3240
msgid ""
@@ -3535,6 +3558,11 @@ msgid ""
3535
3558
"join the process. Even so it is probably good practice to explicitly join "
3536
3559
"all the processes that you start."
3537
3560
msgstr ""
3561
+ "在 Unix 上,如果一个进程执行完成但是没有被 join,就会变成僵尸进程。一般来说,僵尸进程不会很多,因为每次新启动进程(或者 "
3562
+ ":func:`~multiprocessing.active_children` 被调用)时,所有已执行完成且没有被 join 的进程都会自动被 "
3563
+ "join,而且对一个执行完的进程调用 :meth:`Process.is_alive "
3564
+ "<multiprocessing.Process.is_alive>` 也会 join 这个进程。尽管如此,对自己启动的进程显式调用 join "
3565
+ "依然是最佳实践。"
3538
3566
3539
3567
#: ../../library/multiprocessing.rst:2813
3540
3568
msgid "Better to inherit than pickle/unpickle"
@@ -3623,6 +3651,7 @@ msgid ""
3623
3651
"However, it is better to pass the object as an argument to the constructor "
3624
3652
"for the child process."
3625
3653
msgstr ""
3654
+ "在Unix上,使用 *fork* 方式启动的子进程可以使用父进程中全局创建的共享资源。不过,最好是显式将资源对象通过参数的形式传递给子进程。"
3626
3655
3627
3656
#: ../../library/multiprocessing.rst:2873
3628
3657
msgid ""
0 commit comments