When to Choose Async and TPL
 

Recent versions of .Net Framework provides two good features.

  1. Async/Await
  2. Task parallel Library (TPL)

I hear from a lot of people who are confused about when to use these features.  These two are solving 2 different problems of computer science.

  1. Need for faster processing (CPU)
  2. Waiting for dependent operations

Task parallel Library(TPL) optimally uses the multi-core CPU’s and reduces the time spent in doing a complex computation (like finding the millionth prime number). However, Async/Await keywords can help utilize the time wasted in waiting for completing dependent operations (like waiting for File writing, availability of port/buffer etc).

I hope this will give you a basic understanding of how these two features are different and when to use them.