title: Issue with multiprocessing and Queues in python
body: <p>i am looking into using the multiprocessing module in python and have more or less solved the multiprocessing part but have a problem with using and understanding the Queue functionality!</p>
  
  <p>Here it is what i trying to do, the idea is to start a process with a tail to a file and the second process to execute a command on a server! Both processes are using pexpect to connect to the server and the goal is to catch the log lines when the second process executes the command.</p>
  
  <p>I managed to start the 'tail -f' process and also to send the 'stop Client' command on the second process. I get the results from the tail process in queue1 but i never see the result from the second process in queue2! Have in mind that the command 'stop Client' is successful executed since i see on the server that the 'Client is stopped'.</p>
  
  <p>I assume that i haven't yet understand how to handle the Queue with two different processes!</p>
  
  <p>Any clue maybe what could be my fault thinking?</p>
  
  <p>Thanks in adv.</p>
  
  <pre><code>def connectServer(que):                        # daemon
      child = pexpect.spawn('ssh server1')
      child.expect(['(?i)Password'], timeout=20)
      child.sendline(password)
      child.expect([cmdprompt])
      print 'Connected successful'
      cmd = 'tail -f ...\n'
      child.sendline(cmd)
      child.expect([pexpect.TIMEOUT], timeout=30)
      before = child.before
      child.sendline("exit")
      child.close()
      before = re.split('\r\n',before)
      del before[0]
      del before[-1]
      que.put(before)
  
  def stopClient(que):                          # non-deamon
      ld = pexpect.spawn('ssh server1')
      ld.expect(['(?i)Password'], timeout=20)
      ld.sendline(password)
      ld.expect([cmdprompt])
      cmd = 'stop client'
      ld.sendline(cmd)
      ld.expect([cmdprompt], timeout=60)
      before = ld.before
      ld.sendline("exit")
      ld.close()
      before = re.split('\r\n',before)
      que.put(before)
  
  queue1 = multiprocessing.Queue()
  c = multiprocessing.Process(name='connectServer', target=connectServer, args=(queue1,))
  c.daemon = True
  
  queue2 = multiprocessing.Queue()
  s = multiprocessing.Process(name='stopClient', target=stopClient, args=(queue2,))
  s.daemon = False
  
  c.start()
  time.sleep(1)
  s.start()
  
  tmp = queue1.get()
  received = '\r\n'.join(tmp)
  print(received)
  
  tmp = queue2.get()
  received = '\r\n'.join(tmp)
  print(received)
  
  c.join()
  s.join()
  </code></pre>