Python multiprocessing Module
Example
Print CPU count (no processes started):
import multiprocessing
print(multiprocessing.cpu_count())
Try it Yourself »
Definition and Usage
The multiprocessing module lets you run code in parallel using processes.
Use it to bypass the GIL for CPU-bound tasks and to share data between processes with queues and pipes.
Members
Member | Description |
---|---|
cpu_count() | Return the number of CPUs in the system. |
Process | Class to create and manage a separate process. |
Queue | Process-safe FIFO queue for communication between processes. |