Created
October 3, 2013 09:54
-
-
Save FernandoVezzali/6807678 to your computer and use it in GitHub Desktop.
Waiting for Parallel Tasks to Complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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