title: Real-time-ability python multiprocessing (Queue and Pipe)
body: <p>I am a little bit confused testing the multiprocessing module.</p>
  
  <p>Let's simulate a digital timer. The code would look like:</p>
  
  <pre><code>start=datetime.now()
  while True:
      now=datetime.now()
      delta=now-start
      s = delta.seconds + delta.microseconds/1E6
      print s
      time.sleep(1)
  </code></pre>
  
  <p>Which returns correctly:</p>
  
  <pre><code>8e-06
  1.001072
  2.00221
  3.003353
  4.004416
  ...
  </code></pre>
  
  <p>Now I want to read the clock from my virtual external digital clock device using a pipe:</p>
  
  <pre><code>def ask_timer(conn):
  
      start=datetime.now()
      while True:
          now=datetime.now()
          delta=now-start
          s = delta.seconds + delta.microseconds/1E6
          conn.send(s)
  
  
  parent_conn, child_conn = Pipe()
  p = Process(target=ask_timer, args=(child_conn,))
  p.start()
  
  
  while True:
      print parent_conn.recv()
      time.sleep(1)
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>2.9e-05
  6.7e-05
  7.7e-05
  8.3e-05
  8.9e-05
  9.4e-05
  0.0001
  ...
  </code></pre>
  
  <p>Here the  timer doesn't seem to run permanently in the background..The implementation of "Queue" looks like:</p>
  
  <pre><code>def ask_timer(q):    
  
      while True:
          now=datetime.now()
          delta=now-start
          s = delta.seconds + delta.microseconds/1E6
          q.put(s)
          #conn.close()
  
  
  
  
  q = Queue()
  p = Process(target=ask_timer, args=(q,))
  p.start()
  
  
  while True:
      print q.get()
      time.sleep(1)
  </code></pre>
  
  <p>which does the same like pipe. Is this just my misconception of multiprocessing of python? How could I ask a value realtime from a running parallel-thread? </p>