title: python multiprocessing slow
body: <p>I have some code that parallelizes calls to a function. Inside the function, I check if a file exists, if not then I create it, else I do nothing.</p>
  
  <p>I find that if the files do exist, then calling multiprocessing.process has a fairly huge time penalty compared to a simple for loop. Is this expected or is there something I can do to reduce the penalty?</p>
  
  <pre><code>def fn():
      # Check if file exists, if yes then return else make the file
      if(not(os.path.isfile(fl))):
          # processing takes enough time to make the paralleization worth it
      else:
          print 'file exists'
  
  
  pkg_num = 0
  total_runs    = 2500
  threads = []
  
  while pkg_num &lt; total_runs or len(threads):
      if(len(threads) &lt; 3 and pkg_num &lt; total_runs):
          t = multiprocessing.Process(target=fn,args=[])
          pkg_num = pkg_num + 1
          t.start()
          threads.append(t)
      else:
          for thread in threads:
              if not thread.is_alive():
                  threads.remove(thread)
  </code></pre>