On this page
multiprocessing.set_forkserver_preload
Prev: multiprocessing.set_executable | Up: multiprocessing | Next: multiprocessing.set_start_method
Rel: multiprocessing.active_children, multiprocessing.allow_connection_pickling, multiprocessing.Array, multiprocessing.AuthenticationError
Ref: docs.python.org — multiprocessing.set_forkserver_preload
Tags: #public #python3 #stdlib #multiprocessing
Import
import multiprocessing
from multiprocessing import set_forkserver_preload
Signature & Overview
multiprocessing.set_forkserver_preload(module_names)
Set list of module names to try to load in forkserver process.
Usage
import multiprocessing as mp
# Pre-imports heavy modules once in the forkserver process before workers are forked
assert callable(mp.set_forkserver_preload)
Gotchas
- Only applies to
"forkserver"start method: Must be called before the forkserver starts.
REPL Inspect
from multiprocessing import set_forkserver_preload
help(set_forkserver_preload)
Linked from
Related notes
- tuts/python3/stdlib_module/multiprocessing/set_executable Linked here; links to this page; shared tags: #multiprocessing, #stdlib
- tuts/python3/stdlib_module/multiprocessing/set_start_method 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