Python multithreading module crashing without an error message

Viewed 133

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?

1 Answers
Related