title: How to use python multiprocessing pool in continuous loop
body: <p>I am using python multiprocessing library for executing a selenium script. My code is below :</p>
  
  <pre><code>#-- start and join multiple threads ---
  thread_list = []
  total_threads=10 #-- no of parallel threads
  for i in range(total_threads):
      t = Process(target=get_browser_and_start, args=[url,nlp,pixel])
      thread_list.append(t)
      print "starting thread..."
      t.start()
  
  for t in thread_list:
      print "joining existing thread..."
      t.join()
  </code></pre>
  
  <p>As I understood the <code>join()</code> function, it will wait for each process to complete. But I want that as soon as a process is released, it will be assigned another task to perform new function.</p>
  
  <p>It can be understood like this:</p>
  
  <p>Say 8 processes started in first instance.</p>
  
  <pre><code>no_of_tasks_to_perform = 100
  
  for i in range(no_of_tasks_to_perform):
      processes start(8)
      if process no 2 finished executing, start new process
      maintain 8 process at any point of time till 
      "i" is &lt;= no_of_tasks_to_perform
  </code></pre>