Python: How to reuse Pool in multiprocessing and append new processes to running Pool?
In documentation for multiprocessing you can see example with Pool
similar to
from multiprocessing import Pool
def function(x):
return x*x
if __name__ == '__main__':
with Pool(5) as pool:
print(pool.map(function, [1, 2, 3]))
print(pool.map(function, [3, 4, 5]))
print(pool.apply(function, [9,])) # it …