@@ -186,13 +186,21 @@ msgid ""
186186"``SharedMemoryManager``, we avoid the need to manually track and trigger the"
187187" freeing of shared memory resources."
188188msgstr ""
189+ "调用 :class:`SharedMemoryManager` 实例上的 "
190+ ":meth:`~multiprocessing.managers.BaseManager.start` "
191+ "方法会启动一个新进程。这个新进程的唯一目的就是管理所有由它创建的共享内存块的生命周期。想要释放此进程管理的所有共享内存块,可以调用实例的 "
192+ ":meth:`~multiprocessing.managers.BaseManager.shutdown()` 方法。这会触发执行它管理的所有 "
193+ ":class:`SharedMemory` 对象的 :meth:`SharedMemory.unlink()` 方法,然后停止这个进程。通过 "
194+ "``SharedMemoryManager`` 创建 ``SharedMemory`` 实例,我们可以避免手动跟踪和释放共享内存资源。"
189195
190196#: ../../library/multiprocessing.shared_memory.rst:196
191197msgid ""
192198"This class provides methods for creating and returning :class:`SharedMemory`"
193199" instances and for creating a list-like object (:class:`ShareableList`) "
194200"backed by shared memory."
195201msgstr ""
202+ "这个类提供了创建和返回 :class:`SharedMemory` 实例的方法,以及以共享内存为基础创建一个列表类对象 "
203+ "(:class:`ShareableList`) 的方法。"
196204
197205#: ../../library/multiprocessing.shared_memory.rst:200
198206msgid ""
@@ -201,24 +209,27 @@ msgid ""
201209"may be used to connect to an existing ``SharedMemoryManager`` service from "
202210"other processes."
203211msgstr ""
212+ "有关继承的可选输入参数 *address* 和 *authkey* 以及他们如何用于从进程连接已经存在的 "
213+ "``SharedMemoryManager`` 服务,参见 :class:`multiprocessing.managers.BaseManager`"
214+ " "
204215
205216#: ../../library/multiprocessing.shared_memory.rst:207
206217msgid ""
207218"Create and return a new :class:`SharedMemory` object with the specified "
208219"``size`` in bytes."
209- msgstr ""
220+ msgstr "使用 ``size`` 参数,创建一个新的指定字节大小的 :class:`SharedMemory` 对象并返回。 "
210221
211222#: ../../library/multiprocessing.shared_memory.rst:212
212223msgid ""
213224"Create and return a new :class:`ShareableList` object, initialized by the "
214225"values from the input ``sequence``."
215- msgstr ""
226+ msgstr "创建并返回一个新的 :class:`ShareableList` 对象,通过输入参数 ``sequence`` 初始化。 "
216227
217228#: ../../library/multiprocessing.shared_memory.rst:216
218229msgid ""
219230"The following example demonstrates the basic mechanisms of a "
220231":class:`SharedMemoryManager`:"
221- msgstr ""
232+ msgstr "下面的案例展示了 :class:`SharedMemoryManager` 的基础机制: "
222233
223234#: ../../library/multiprocessing.shared_memory.rst:234
224235msgid ""
@@ -227,13 +238,17 @@ msgid ""
227238" to ensure that all shared memory blocks are released after they are no "
228239"longer needed:"
229240msgstr ""
241+ "以下案例展示了 :class:`SharedMemoryManager` 对象的一种可能更方便的使用方式,通过 :keyword:`with` "
242+ "语句来保证所有共享内存块在使用完后被释放。"
230243
231244#: ../../library/multiprocessing.shared_memory.rst:253
232245msgid ""
233246"When using a :class:`SharedMemoryManager` in a :keyword:`with` statement, "
234247"the shared memory blocks created using that manager are all released when "
235248"the :keyword:`with` statement's code block finishes execution."
236249msgstr ""
250+ "当在 :keyword:`with` 语句中使用 :class:`SharedMemoryManager` "
251+ "对象的时候,使用这个管理器创建的共享内存块会在 :keyword:`with` 语句代码块结束后被释放。"
237252
238253#: ../../library/multiprocessing.shared_memory.rst:260
239254msgid ""
@@ -264,13 +279,13 @@ msgstr ""
264279
265280#: ../../library/multiprocessing.shared_memory.rst:280
266281msgid "Returns the number of occurrences of ``value``."
267- msgstr ""
282+ msgstr "返回 ``value`` 出现的次数。 "
268283
269284#: ../../library/multiprocessing.shared_memory.rst:284
270285msgid ""
271286"Returns first index position of ``value``. Raises :exc:`ValueError` if "
272287"``value`` is not present."
273- msgstr ""
288+ msgstr "返回 ``value`` 首次出现的位置,如果 ``value`` 不存在, 则抛出 :exc:`ValueError` 异常。 "
274289
275290#: ../../library/multiprocessing.shared_memory.rst:289
276291msgid ""
0 commit comments