title: Not able to use pool.apply_async()
body: <p>I'm just working around with the multiprocessing module of Python but <strong><em>the following code is running continuously but not giving any output</em></strong>. What am I doing wrong? I have also tried <code>pool.close()</code> and <code>pool.join()</code> but with no effect. </p>
  
  <p>Here's what I have tried so far:</p>
  
  <pre><code>import multiprocessing as mp
  cpu_count = mp.cpu_count()
  pool = mp.Pool(processes = cpu_count)
  
  def func(val):
      print "\nInside Function.....\n"
      return val*val
  
  results = []
  num = 1
  while cpu_count &gt;= 1:
      results.append(pool.apply_async(func, (num,)))
      cpu_count = cpu_count - 1
      num = num + 1
  
  output = [p.get() for p in results]
  print output
  </code></pre>