swansonk14 / p_tqdm

Parallel processing with progress bars
MIT License
457 stars 44 forks source link

Is any like such as multiprocess.close() needed? #15

Closed TommasoBendinelli closed 4 years ago

TommasoBendinelli commented 4 years ago

Hello, Thanks for the nice work. Do I need any line of code such as multiprocess.close or equivalent at the end or p_tqdm takes care of closing the workers once the work is done?

Maybe it would be nice to add this info in the readme.

Best, Tommaso

swansonk14 commented 4 years ago

Hi @TommasoBendinelli, thank you for the question and the suggestion! The parallel Pool object doing the multiprocessing is automatically closed when the p_tqdm map finishes (you can see here) so you don't need to worry about closing it. I've added a note at the end of the README explaining this.

I'm 99% sure the Pool objects close correctly, but please do let me know if you run into any situations where they aren't closing.