Skip to content

Instantly share code, notes, and snippets.

@DanielOberg
Created November 5, 2010 09:52
Show Gist options
  • Save DanielOberg/663901 to your computer and use it in GitHub Desktop.
Save DanielOberg/663901 to your computer and use it in GitHub Desktop.
Async calling as it was ment to be.
//http://msdn.microsoft.com/en-us/library/dd537609.aspx
Task[] tasks = new Task[3]
{
Task.Factory.StartNew(() => MethodA()),
Task.Factory.StartNew(() => MethodB()),
Task.Factory.StartNew(() => MethodC())
};
//Block until all tasks complete.
Task.WaitAll(tasks);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment