I'm using multiprocessing.Pool in 2 function that run sequentially. I create the Pool in the first function and when it terminate, I close it and open it in the second.
multiprocessing.Pool
Pool
Ex.
def first_function(): pool = multiprocessing.Pool() . . pool.join() pool.close() def second_function(): pool = multiprocessing.Pool() . . pool.join() pool.close()
Is it more efficient to create one single Pool before the 2 functions start and then pass it like argument?
2.1m questions
2.1m answers
60 comments
57.0k users