Top "Task-parallel-library" questions

The Task Parallel Library is part of the .NET Framework since .NET 4. It is a set of APIs to enable developers to program asynchronous applications.

Using async/await for multiple tasks

I'm using an API client that is completely asynchrounous, that is, each operation either returns Task or Task<T&…

c# .net task-parallel-library async-await c#-5.0
Running multiple async tasks and waiting for them all to complete

I need to run multiple async tasks in a console application, and wait for them all to complete before further …

c# .net asynchronous task-parallel-library async-await
When to use Task.Delay, when to use Thread.Sleep?

Are there good rule(s) for when to use Task.Delay versus Thread.Sleep? Specifically, is there a minimum value …

c# multithreading task-parallel-library
Calling async method synchronously

I have an async method: public async Task<string> GenerateCodeAsync() { string code = await GenerateCodeService.GenerateCodeAsync(); return code; } I …

c# asp.net asynchronous task-parallel-library async-await
Asynchronously wait for Task<T> to complete with timeout

I want to wait for a Task<T> to complete with some special rules: If it hasn't completed …

c# .net task-parallel-library
Catch an exception thrown by an async void method

Using the async CTP from Microsoft for .NET, is it possible to catch an exception thrown by an async method …

c# asynchronous exception-handling async-await task-parallel-library
How to safely call an async method in C# without await

I have an async method which returns no data: public async Task MyAsyncMethod() { // do some stuff async, don't return any …

c# exception async-await task task-parallel-library
What is the difference between task and thread?

In C# 4.0, we have Task in the System.Threading.Tasks namespace. What is the true difference between Thread and Task. …

c# multithreading c#-4.0 task-parallel-library terminology
Best practice to call ConfigureAwait for all server-side code

When you have server-side code (i.e. some ApiController) and your functions are asynchronous - so they return Task<…

c# asp.net-web-api task-parallel-library async-await
Deserialize JSON to Array or List with HTTPClient .ReadAsAsync using .NET 4.0 Task pattern

I'm trying to deserialize the JSON returned from http://api.usa.gov/jobs/search.json?query=nursing+jobs using the .…

c# json asp.net-mvc-4 task-parallel-library dotnet-httpclient