What Is a Task?
In the Task Parallel Library and parallel computing with the .NET Framework, the basic and most important concept is the task, which represents an asynchronous operation. Tasks typically represent delegates that are queued to the thread pool for execution. The thread pool can automatically determine and adjust the number of threads via automatic load balancing to maximize performances. In this way, tasks are generally lightweight and independent, and they can run concurrently, thus making it easier to enable efficient parallelism. In terms of code, a task is nothing but an instance of the System.Threading.Tasks.Task class that holds a reference to a delegate, pointing to a method that does some work. The power of the Task class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access