@@ -38,7 +38,8 @@ copying of data.
38
38
39
39
.. class :: SharedMemory(name=None, create=False, size=0)
40
40
41
- Creates a new shared memory block or attaches to an existing shared
41
+ Create an instance of the :class: `!SharedMemory ` class for either
42
+ creating a new shared memory block or attaching to an existing shared
42
43
memory block. Each shared memory block is assigned a unique name.
43
44
In this way, one process can create a shared memory block with a
44
45
particular name and a different process can attach to that same shared
@@ -51,30 +52,35 @@ copying of data.
51
52
When a shared memory block is no longer needed by any process, the
52
53
:meth: `unlink ` method should be called to ensure proper cleanup.
53
54
54
- *name * is the unique name for the requested shared memory, specified as
55
- a string. When creating a new shared memory block, if ``None `` (the
56
- default) is supplied for the name, a novel name will be generated.
55
+ :param name:
56
+ The unique name for the requested shared memory, specified as a string.
57
+ When creating a new shared memory block, if ``None `` (the default)
58
+ is supplied for the name, a novel name will be generated.
59
+ :type name: str | None
57
60
58
- *create * controls whether a new shared memory block is created (``True ``)
59
- or an existing shared memory block is attached (``False ``).
61
+ :param bool create:
62
+ Control whether a new shared memory block is created (``True ``)
63
+ or an existing shared memory block is attached (``False ``).
60
64
61
- *size * specifies the requested number of bytes when creating a new shared
62
- memory block. Because some platforms choose to allocate chunks of memory
63
- based upon that platform's memory page size, the exact size of the shared
64
- memory block may be larger or equal to the size requested. When attaching
65
- to an existing shared memory block, the *size * parameter is ignored.
65
+ :param int size:
66
+ The requested number of bytes when creating a new shared memory block.
67
+ Because some platforms choose to allocate chunks of memory
68
+ based upon that platform's memory page size, the exact size of the shared
69
+ memory block may be larger or equal to the size requested.
70
+ When attaching to an existing shared memory block,
71
+ the *size * parameter is ignored.
66
72
67
73
.. method :: close()
68
74
69
- Closes access to the shared memory from this instance. In order to
75
+ Close access to the shared memory from this instance. In order to
70
76
ensure proper cleanup of resources, all instances should call
71
77
:meth: `close ` once the instance is no longer needed. Note that calling
72
78
:meth: `!close ` does not cause the shared memory block itself to be
73
79
destroyed.
74
80
75
81
.. method :: unlink()
76
82
77
- Requests that the underlying shared memory block be destroyed. In
83
+ Request that the underlying shared memory block be destroyed. In
78
84
order to ensure proper cleanup of resources, :meth: `unlink ` should be
79
85
called once (and only once) across all processes which have need
80
86
for the shared memory block. After requesting its destruction, a
@@ -258,7 +264,7 @@ finishes execution.
258
264
259
265
.. class :: ShareableList(sequence=None, *, name=None)
260
266
261
- Provides a mutable list-like object where all values stored within are
267
+ Provide a mutable list-like object where all values stored within are
262
268
stored in a shared memory block.
263
269
This constrains storable values to the following built-in data types:
264
270
@@ -315,12 +321,12 @@ finishes execution.
315
321
316
322
.. method :: count(value)
317
323
318
- Returns the number of occurrences of *value *.
324
+ Return the number of occurrences of *value *.
319
325
320
326
.. method :: index(value)
321
327
322
- Returns first index position of *value *. Raises :exc: ` ValueError ` if
323
- *value * is not present.
328
+ Return first index position of *value *.
329
+ Raise :exc: ` ValueError ` if *value * is not present.
324
330
325
331
.. attribute :: format
326
332
0 commit comments