multiprocessing.Barrier
Prev: multiprocessing.AuthenticationError | Up: multiprocessing | Next: multiprocessing.BoundedSemaphore
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.Barrier
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import Barrier
Signature & Overview
multiprocessing.Barrier(parties, action=None, timeout=None)
Returns a barrier object
Usage
import multiprocessing as mp
b = mp.Barrier(1)
assert b.wait(timeout=1) == 0
Gotchas
- Process-safe counterpart to
threading.Barrier: Always passtimeout=so a crashed child process doesn't hang the remaining workers.
REPL Inspect
from multiprocessing import Barrier
help(Barrier)
Linked from
- tuts/python3/stdlib_module/multiprocessing
- tuts/python3/stdlib_module/multiprocessing/active_children
- tuts/python3/stdlib_module/multiprocessing/allow_connection_pickling
- tuts/python3/stdlib_module/multiprocessing/Array
- tuts/python3/stdlib_module/multiprocessing/AuthenticationError
- tuts/python3/stdlib_module/multiprocessing/BoundedSemaphore
Related notes
- tuts/python3/stdlib_module/multiprocessing/active_children Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/allow_connection_pickling Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Array Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/AuthenticationError Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/BoundedSemaphore 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/BufferTooShort shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Condition shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/cpu_count shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/current_process shared tags: #multiprocessing, #stdlib