title: Multiprocessing in Python hanging the system
body: <p>I am working on multiprocessing and  trying to replicate the code given in the below link:</p>
  <p><a href="https://stackoverflow.com/questions/40954559/python-multiprocessing-imap">Python Multiprocessing imap</a></p>
  <p>My system is hanging in both Spyder and Jupyter as shown following. What could be the reason?</p>
  <p><a href="https://i.stack.imgur.com/oe1iD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oe1iD.png" alt="enter image description here" /></a></p>
  <p>Following is the code exactly copied and running. But it is just hanging.</p>
  <pre><code>from multiprocessing import Pool
  
  def f(x):
      return x*x
  
  if __name__ == '__main__':
      with Pool(3) as p:
          print(p.map(f, [1, 2, 3]))
  </code></pre>