Creating Threads
Explore how to create and launch threads in C# using various approaches including the ThreadStart delegate, lambda expressions, and local functions. Understand thread states and how to start threads for concurrent execution to enhance application responsiveness and avoid blocking.
We'll cover the following...
It is possible to create and launch multiple threads within a single .NET application. We use one of the Thread class constructors to create a thread and must provide an action that executes on it. An action, in this context, is essentially a method that runs on the thread we create.
The Thread class supports two types of methods:
Parameterless methods that do not return any value.
Parameterized methods that do not return any value.
In this lesson, we will cover the execution of parameterless methods.
The ThreadStart delegate
The Thread class supports parameterless methods that have the same signature and return type as the ...