graph LR
Pool_Manager["Pool Manager"]
Worker_Process["Worker Process"]
Worker_Factory["Worker Factory"]
Pool_Manager -- "delegates worker creation to" --> Worker_Factory
Pool_Manager -- "dispatches tasks to" --> Worker_Process
Worker_Process -- "sends results to" --> Pool_Manager
Worker_Factory -- "instantiates and prepares" --> Worker_Process
click Pool_Manager href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/aiomultiprocess/Pool_Manager.md" "Details"
click Worker_Process href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/aiomultiprocess/Worker_Process.md" "Details"
This subsystem focuses on the core mechanics of managing and executing tasks in parallel using a combination of multiprocessing and asyncio. It adheres to the Worker Pool architectural pattern, central to a concurrency and parallel processing library.
Pool Manager [Expand]
The aiomultiprocess.pool.Pool component acts as the central orchestrator of the process pool. It is responsible for managing the lifecycle of worker processes, distributing tasks to them, and collecting their results. It serves as the primary interface for users to interact with the parallel execution capabilities.
Related Classes/Methods:
Worker Process [Expand]
An independent Python process, represented by aiomultiprocess.pool.PoolWorker, designed to execute tasks. Each worker maintains its own asyncio event loop, enabling internal concurrency for I/O-bound operations, while operating in a separate process to achieve true CPU parallelism, bypassing the Global Interpreter Lock (GIL). It handles inter-process communication (IPC) for receiving tasks and sending results.
Related Classes/Methods:
The aiomultiprocess.pool.create_worker function is responsible for the instantiation and initial setup of Worker Process instances. It encapsulates the logic for preparing a new process to join the pool, ensuring it's ready to receive and execute tasks.
Related Classes/Methods: