I want to create multiprocessing Python script, and i created that, but i have one idea for size Pool. I want to do multiprocessing so that when the CPU reaches 90% it reduces the size of the Pool.
I wached on google that Pool size not change.
How can i do this? Does anyone have an idea
Simple example by which i worked:
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == '__main__':
with Pool(12) as p:
print(p.map(f, range(10000000)))
Thanks all for answers!