title: Can a python Multiprocessing queue be passed to the child process?
body: <p>I have a big dataset in a data acquisition system I wrote in python that takes infinitely long to pass over a queue from the child process to the parent. I want to save the data acquired at the end of the acquisition and tried this using the <code>queue</code> function in <code>Multiprocessing</code>. Instead of doing it this way I would prefer it if I could instead pass a message over the <code>queue</code> from the parent to the child to save my data before I kill the child process. Is this possible? An example of what I thought it might look like is:</p>
  
  <pre><code>def acquireData(self, var1, queue):
      import h5py
      # Put my acquisition code here
      queue.get()
      if queue == True:
          f = h5py.File("FileName","w")
          f.create_dataset('Data',data=data)
          f.close()
  
  if __name__ == '__main__': 
      from multiprocessing import Process, Queue
      queue = Queue()
      inter_thread = Process(target=acquireData, args=(var1,queue))
      queue.put(False)
      inter_thread.start()
      while True:
          if not args.automate:
          # Let c++ threads run for given amount of time
              # Wait for stop from OP GUI
          else:
              queue.put(True)
              break
      print("Acquisition finished, cleaning up...")
      sleep(2)
      inter_thread.terminate()
  </code></pre>
  
  <p>Is this allowed? If this type of interfacing between processes is allowed then do I have the right notation? For some reference I have on the order of 9e7 data points in the array I'm trying to save and I have 7 arrays which is simply not being passed to my parent process in a timely manner by putting these arrays into the <code>queue</code>. Thank you.</p>