multiprocessing.RawValue
Prev: multiprocessing.RawArray | Up: multiprocessing | Next: multiprocessing.RLock
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.RawValue
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import RawValue
Signature & Overview
multiprocessing.RawValue(typecode_or_type, *args)
Returns a shared object
Usage
import multiprocessing as mp
val = mp.RawValue("i", 7)
val.value = 10
assert val.value == 10
Gotchas
- No built-in lock: Pair with an explicit
mp.Lock()if multiple processes write to.value.
REPL Inspect
from multiprocessing import RawValue
help(RawValue)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/RawArray Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/RLock 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