Search⌘ K

Creating Threads

Understand how to create and launch threads in C# by using the Thread class and ThreadStart delegate. Learn different ways to pass methods to threads, start execution, and improve application responsiveness with multithreading.

Introduction

It’s possible to create and launch multiple threads within a single .NET application. We can use one of the Thread class constructors to create a thread. We must provide an action that executes on our thread. 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 don’t return any value (void).
  • Parameterized methods that don’t return any value (void).

In this lesson, we’ll cover the execution of parameterless methods. ...