In the following scenario: can we block the main thread to begin to perform step 3 until step 2 finished?
I'm talking about C#
//step 1: some tasks
/*
*/
//step 2: perform some sub tasks in parallel.
Parallel.ForEach(X, x => Foo(x));
//step 3: Some other task
//Can we begin to perform step 3 until all sub tasks in step 2 finished???