Reputation: 192
When I run my code, it just straight up doesn't do anything. The python interpreter just sits there and hangs until I close it. I don't even get an error message. What could be causing this? This is my code:
import multiprocessing
def worker(x):
return x
pool = multiprocessing.Pool()
print(pool.map(worker, range(10)))
print (1)
Nothing is ever printed. It simply stops. How do I even begin to fix this?
Upvotes: 2
Views: 324
Reputation: 58
While I am unsure why this doesn't work for you, I had a similar problem on my system. I overcame it by using multiprocessing.Pipe
, which you can find here https://docs.python.org/3/library/multiprocessing.html
Upvotes: 2