Python's multiprocessing Pool context manager exit calls .terminate(), but a very common pattern that does not use context manager is
p = Pool()
p.map(do)
p.close()
p.join()
I know that map blocks, and therefore when done in a context manager, there isn't a need to call .close() and .join() (or is it actually better to call them?):
with Pool() as p:
p.map(do)
I also know that .close() and .join() are useful for non-blocking usages e.g. apply_async.
If there are some other important reasons to call .close() then .join(), why isn't it in the exit call of Pool context manager? If there are no other benefits, shouldn't we do the following instead:
p = Pool()
p.map(do)
p.terminate()