multiprocessing.RawArray
Prev: multiprocessing.Queue | Up: multiprocessing | Next: multiprocessing.RawValue
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.RawArray
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import RawArray
Signature & Overview
multiprocessing.RawArray(typecode_or_type, size_or_initializer)
Returns a shared array
Usage
import multiprocessing as mp
raw = mp.RawArray("d", [1.5, 2.5])
assert list(raw) == [1.5, 2.5]
Gotchas
- No built-in lock: Faster than
mp.Arraywhen you manage synchronization externally (e.g., read-only shared data or a single coarseLock).
REPL Inspect
from multiprocessing import RawArray
help(RawArray)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/Queue Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/RawValue Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/multiprocessing/active_children Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/allow_connection_pickling Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Array Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/AuthenticationError Linked here; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Barrier shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/BoundedSemaphore shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/BufferTooShort shared tags: #multiprocessing, #stdlib