title: multiprocessing in Python 3.6
body: <p>I have dictionary of dictionaries I am iterating through. Currently I run this in serial, processing 1 item in the list at a time and this works fine, but I would like to speed up the processing of these by using the multiprocessing library.</p>
  
  <p>There is a lot of info available regarding Process/Threads/Pools but am unsure how I would go about implementing this.</p>
  
  <p>I'd like to have the option to specify for example max of 5 threads/processes at a time but am unsure how the iteration works (i.e. do I iterate through the 'tasks' first or do I iterate through the number of threads/processes?</p>
  
  <p>e.g. I have a single dictionary containing 2 levels of hierarchy:</p>
  
  <pre><code>dict = {'router1': {'id': 1, 'name': 'rtr1_core'}, 'router2': {'id': 2, 'name': 'rt2_core'}, 'router3': {'id': 3, 'name': 'rtr3_access'}}
  </code></pre>
  
  <p>(Note, I've simplified the list of items in each of the routers - realistically there are 20+ keys in each dict, but I'm using id and name to keep it simple.)</p>
  
  <p>So I iterate through router1... router 3 and each '{'id': 1, 'name': 'rtr1_core'}' dictionary needs to be passed to the 'process_routers' function containing a single argument (the dict).</p>
  
  <p>I don't need to share info between processes.</p>
  
  <p>I've managed to get:</p>
  
  <pre><code>    # Process the data
      p = multiprocessing.Process(target=process_rtr, args=(rtr_data,))
      p.start()
      p.join()
  </code></pre>
  
  <p>Which seems to run it in serial still - how do I run these in parallel in up to x threads?</p>
  
  <p>In reality I'm looking to execute the process_rtr function about 50k times in about 5-10 threads based on our current hardware. So it would be great to specify number of threads/processes so I can adjust this as needed.</p>
  
  <p>Many Thanks for your time and help in advance.</p>
  
  <p>Frank </p>