Python Forum

Full Version: Please explain me Pathos Pool()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is this scheme right? Or it forks only with for i in range?
from pathos.multiprocessing import ProcessingPool as Pool
p=Pool()
def calculating (arg1,arg2):
    **some calculating**
    return result
result=p.map(calculating,arg1,arg2)
print result
Thanks!
pool is just the name assigned to the imported package (pathos.multiprocessing, ProcessingPool class)
pool() - creates an instance of the ProcessingPool class
see docs: http://pathos.readthedocs.io/en/latest/