Multiprocessing pools
When working with multiple processes within our Python applications, we have the option to leverage the very versatile Pool
class that lives within the multiprocessing module.
The Pool implementation allows us to succinctly spin up a number of child processes within our programs, and then delegate tasks for the workers in these pools to pick up.
The difference between concurrent.futures.ProcessPoolExecutor and Pool
We covered concurrent.futures.ProcessPoolExecutors
in Chapter 7, Executors and Pools, so, what is the need for another implementation of a process pool?
The multiprocessing.Pool
implementation of process pools utilizes an almost identical implementation in order to provide parallel processing capabilities. However, the aim of the concurrent.futures
module was to provide a simpler interface to work with when creating process pools. This simpler interface is easy for programmers to immediately start working with both Thread and process pools. However, with this...