title: Joining task-parallel threads
body: <p>I know how to join a simple thread to make parent thread wait for them but I don't know how to do it for automatic threads implemented in System.Threading.Tasks namespace . Here's an example . I call two functions in my main function that I want to be executed respectively . Each function has an parallel.for inside it . Now how can I make the main thread wait for all threads of first function to get finished before calling second function ?</p>
  
  <pre><code>static void Main(string[] args)
  {
       fill();
       // now main should wait for threads of fill function to finish
       filter();
  }
  
  void filter()
  {
       parallel.for(some action);
  }
  
  void fill()
  {
      parallel.for(some action);
  }
  </code></pre>