title: Python Multiprocessing Loop
body: <p>I'm hoping to use <code>multiprocessing</code> to speed up a sluggish loop. However, from what I've seen of multiprocessing examples, I'm not sure if this sort of implementation is good practice, feasible or possible.</p>
  
  <p>There are broadly two parts to the loop: <code>data ingestion</code> and <code>data processing</code>. I would like to have the next part of data ingestion starting while processing is going on, so the data is available as soon as possible.</p>
  
  <p>Pseudo code:</p>
  
  <pre><code>d = get_data(n)
  for n in range(N):
      p = process_data(d)
      d = get_data(n+1) #prepare data for next process loop
  </code></pre>
  
  <ol>
  <li>Does multiprocessing lend itself to this sort of function?</li>
  <li>How would one do this?</li>
  </ol>
  
  <p>Thanks in advance.</p>