multiprocessing.current_process
Prev: multiprocessing.cpu_count | Up: multiprocessing | Next: multiprocessing.Event
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.current_process
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import current_process
Signature & Overview
multiprocessing.current_process()
Return process object representing the current process
Usage
import multiprocessing as mp
proc = mp.current_process()
assert proc.name == "MainProcess"
Gotchas
- Check
current_process().name == "MainProcess"when logging or guarding parent-only setup.
REPL Inspect
from multiprocessing import current_process
help(current_process)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/cpu_count Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/Event 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