Showing posts from September, 2022

ASP.NET Core 6: Taking Advantages of Task Parallel Library

 In this article, we will see the use of the Parallel class of Task Parallel Library in ASP.NET Core 6 MVC Applications. The reason for writing this article is that last week when I was discussing with the client we had a discussion regarding the use of Task Parallel Library in ASP.NET Core 6. There were a couple of scenarios we had discussed and then I thought to write my thoughts on them. Task Parallel Library (TPL) The TPL is introduced in .NET Framework 4.0 under the System.Threading and System.Threading.Task namespaces. The TPL has public types and APIs that simplify the process of writing parallel and concurrency code and hence improve the application's productivity.   The TPL scales the degree of concurrency dynamically to most efficiently use all the processors that are available. The TPL handlers perform the following work: Partitioning the work Schedule threads on ThreadPool   Cancellation support State Management Improvise the performance of the code and accomplish the d