title: Why main process can not exit when I use multiple processes in Python?
body: <p>I hope that all child processes finished, and then main process exit, but it can not exit, why?</p>
  
  <pre><code>#!/usr/bin/env python
  # coding=utf-8
  
  import os
  
  from multiprocessing import Manager
  from multiprocessing import Pool
  
  
  def write_file_name_to_queue(q, src_folder):
      print('Process to write: %s' % os.getpid())
      if not os.path.exists(src_folder):
          print "Please input folder path"
          return
  
      for (dirpath, dirnames, filelist) in os.walk(src_folder):
          for name in filelist:
              if name[0] == '.':
                  continue
              q.put(os.path.join(dirpath, name))
  
  
  def read_file_name_from_queue(q):
      print('Process to read: %s' % os.getpid())
      while True:
          value = q.get(True)
          print('Get %s from queue.' % value)
  
  
  if __name__ == "__main__":
      mg = Manager()
      q = mg.Queue()
      p = Pool()
  
      p.apply_async(func=write_file_name_to_queue, args=(q, "./test/"))
  
      for i in xrange(8):
          p.apply_async(func=read_file_name_from_queue, args=(q,))
  
      p.close()
      p.join()
  </code></pre>
  
  <p>Run it and get the follow result:</p>
  
  <pre><code>➜  check python check_process.py
  Process to write: 3918
  Process to read: 3919
  Process to read: 3920
  Get ./test/a from queue.
  Get ./test/b from queue.
  Get ./test/c from queue.
  Get ./test/e from queue.
  Get ./test/f from queue.
  Process to read: 3921
  Process to read: 3918
  </code></pre>
  
  <p>The process still waits.</p>