title: Running same function for multiple files in parallel in python
body: <p>I am trying to run a function in parallel for multiple files and want all of them to terminate before a point.</p>
  
  <p>For Example:
  There is a loop</p>
  
  <pre><code>def main():
    for item in list:
       function_x(item)
  
    function_y(list)
  </code></pre>
  
  <p>Now what I want is that this <code>function_x</code> should run in parallel for all items. But this function should be executed for all items before my <code>function_y</code> is called. </p>
  
  <p><strong>I am planning to use celery for this. but can not understand how to do this.</strong></p>