Skip to content

Instantly share code, notes, and snippets.

@FernandoVezzali
Created October 3, 2013 09:54
Show Gist options
  • Save FernandoVezzali/6807678 to your computer and use it in GitHub Desktop.
Save FernandoVezzali/6807678 to your computer and use it in GitHub Desktop.
Waiting for Parallel Tasks to Complete
var tasks = new Task[10];
for (var i = 0; i < 10; i++)
{
var x = i;
tasks[i] = Task.Factory.StartNew(() => new WorkerClass(x).Do());
}
Task.WaitAll( tasks );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment