Skip to content Skip to sidebar Skip to footer

Importable `multiprocessing.pool` Function

This is probably simple and I'm just not finding a suitable question. If I do a stand-alone script with multiprocessing.Pool i know I'm supposed to do: def foo(x): return x**2

Solution 1:

I don't see any problem with your code that works fine for me in python3 and python2 (if I don't use the with statement for the Pool). In my opinion, this is a safe way to use multiprocessing and I don't understand why you experience this kind of infinite hanging. What version of Python are you using?


Post a Comment for "Importable `multiprocessing.pool` Function"