• Home
  • Raw
  • Download

Lines Matching full:memory

1 :mod:`multiprocessing.shared_memory` ---  Provides shared memory for direct access across processes
5 :synopsis: Provides shared memory for direct access across processes.
12 single: Shared Memory
13 single: POSIX Shared Memory
14 single: Named Shared Memory
19 and management of shared memory to be accessed by one or more processes
21 the life-cycle management of shared memory especially across distinct
26 In this module, shared memory refers to "System V style" shared memory blocks
28 to "distributed shared memory". This style of shared memory permits distinct
30 volatile memory. Processes are conventionally limited to only have access to
31 their own process memory space but shared memory permits the sharing
33 processes containing that data. Sharing data directly via memory can provide
41 Creates a new shared memory block or attaches to an existing shared
42 memory block. Each shared memory block is assigned a unique name.
43 In this way, one process can create a shared memory block with a
45 memory block using that same name.
47 As a resource for sharing data across processes, shared memory blocks
49 no longer needs access to a shared memory block that might still be
51 When a shared memory block is no longer needed by any process, the
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
58 *create* controls whether a new shared memory block is created (``True``)
59 or an existing shared memory block is attached (``False``).
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.
69 Closes access to the shared memory from this instance. In order to
72 ``close()`` does not cause the shared memory block itself to be
77 Requests that the underlying shared memory block be destroyed. In
80 for the shared memory block. After requesting its destruction, a
81 shared memory block may or may not be immediately destroyed and
83 inside the shared memory block after ``unlink()`` has been called may
84 result in memory access errors. Note: the last process relinquishing
85 its hold on a shared memory block may call ``unlink()`` and
90 A memoryview of contents of the shared memory block.
94 Read-only access to the unique name of the shared memory block.
98 Read-only access to size in bytes of the shared memory block.
113 >>> # Attach to an existing shared memory block
123 >>> shm_a.unlink() # Call unlink only once to release the shared memory
139 >>> # Now create a NumPy array backed by shared memory
141 >>> b[:] = a[:] # Copy the original data into shared memory
154 >>> # Attach to the existing shared memory block
175 >>> shm.unlink() # Free and release the shared memory block at the very end
182 used for the management of shared memory blocks across processes.
187 of all shared memory blocks created through it. To trigger the release
188 of all shared memory blocks managed by that process, call
194 and trigger the freeing of shared memory resources.
198 backed by shared memory.
224 >>> smm.start() # Start the process that manages the shared memory blocks
236 ensure that all shared memory blocks are released after they are no longer
254 shared memory blocks created using that manager are all released when the
261 stored in a shared memory block. This constrains storable values to
271 ``ShareableList`` by its unique shared memory name.
273 *name* is the unique name for the requested shared memory, as described
275 existing ``ShareableList``, specify its shared memory block's unique
331 same :class:`ShareableList` by supplying the name of the shared memory block