On this page
multiprocessing.RLock
Prev: multiprocessing.RawValue | Up: multiprocessing | Next: multiprocessing.Semaphore
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.RLock
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import RLock
Signature & Overview
multiprocessing.RLock()
Returns a recursive lock object
Usage
import multiprocessing as mp
rlock = mp.RLock()
with rlock:
with rlock:
assert True
Gotchas
- Reentrant cross-process lock: Can be acquired multiple times by the same process/thread without deadlocking.
REPL Inspect
from multiprocessing import RLock
help(RLock)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/RawValue Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Semaphore 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