The Thread class has been available since the first version of C# and can be used to create new threads and manage them, but it can be tricky to work with directly.
C# 4 introduced the Task class, which is a wrapper around a thread that enables easier creating and management. Creating multiple threads wrapped in tasks will allow our code to execute asynchronously (at the same time).
Each Task has a Status property and a CreationOptions property, has a ContinueWith method that can be customized with the TaskContinuationOptions enum, and can be managed with the TaskFactory class, as shown in the following diagram:
We will look at three ways to start the methods using Task instances. Each ...