title: python multiprocessing queue is not in shared memory
body: <p>I tried to run the following codes:</p>
  
  <pre><code>import multiprocessing
  import time
  
  def init_queue():
      print("init g_queue start")
      while not g_queue.empty():
          g_queue.get()
      for _index in range(10):
          g_queue.put(_index)
      print("init g_queue end")
      return
  
  def task_io(task_id):
      print("IOTask[%s] start" % task_id)
      print("the size of queue is %s" % g_queue.qsize())
      while not g_queue.empty():
          time.sleep(1)
          try:
              data = g_queue.get(block=True, timeout=1)
              print("IOTask[%s] get data: %s" % (task_id, data))
          except Exception as excep:
              print("IOTask[%s] error: %s" % (task_id, str(excep)))
      print("IOTask[%s] end" % task_id)
      return
  
  g_queue = multiprocessing.Queue()
  
  if __name__ == '__main__':
      print("the size of queue is %s" % g_queue.qsize())
      init_queue()
      print("the size of queue is %s" % g_queue.qsize())
      time_0 = time.time()
      process_list = [multiprocessing.Process(target=task_io, args=(i,)) for i in range(multiprocessing.cpu_count())]
      for p in process_list:
          p.start()
      for p in process_list:
          if p.is_alive():
              p.join()
      print("End:", time.time() - time_0, "\n")
  </code></pre>
  
  <p>what I got was the following:</p>
  
  <pre><code>the size of queue is 0
  init g_queue start
  init g_queue end
  the size of queue is 10
  IOTask[0] start
  the size of queue is 0
  IOTask[0] end
  IOTask[1] start
  the size of queue is 0
  IOTask[1] end
  ('End:', 0.6480000019073486, '\n')
  </code></pre>
  
  <p>What I was expecting was</p>
  
  <pre><code>IOTask[0] start
  the size of queue is 10
  </code></pre>
  
  <p>Because after initialization of g_queue, the size of queue was supposed to be 10, not 0. It seems like the queue is not in the shared memory. When the sub process starts, a copy of g_queue is created and its size is 0. </p>
  
  <p>Why multiprocessing.queue is not in the shared memory? Please advise. Many thanks!</p>