C# | Thread(ThreadStart) Constructor Last Updated : 01 Feb, 2019 Comments Improve Suggest changes Like Article Like Report Thread(ThreadStart) Constructor is used to initialize a new instance of a Thread class. This constructor will give ArgumentNullException if the value of the parameter is null. Syntax: public Thread(ThreadStart start); Here, ThreadStart is a delegate which represents a method to be invoked when this thread begins executing. Below programs illustrate the use of Thread(ThreadStart) Constructor: Example 1: CSharp // C# program to illustrate the // use of Thread(ThreadStart) // constructor with static method using System; using System.Threading; // Driver Class class GFG { // Main Method public static void Main() { // Creating and initializing a thread // with Thread(ThreadStart) constructor Thread thr = new Thread(new ThreadStart(Job)); thr.Start(); } // Static method public static void Job() { Console.WriteLine("Number is :"); for (int z = 0; z < 4; z++) { Console.WriteLine(z); } } } Output: Number is : 0 1 2 3 Example 2: CSharp // C# program to illustrate the // use of Thread(ThreadStart) // constructor with Non-static method using System; using System.Threading; class GThread { // Non-static method public void Job() { for (int z = 0; z < 3; z++) { Console.WriteLine("HELLO...!!"); } } } // Driver Class public class GFG { // Main Method public static void Main() { // Creating object of GThread class GThread obj = new GThread(); // Creating and initializing a thread // with Thread(ThreadStart) constructor Thread thr = new Thread(new ThreadStart(obj.Job)); thr.Start(); } } Output: HELLO...!! HELLO...!! HELLO...!! Reference: https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread.-ctor?view=netframework-4.7.2#System_Threading_Thread__ctor_System_Threading_ThreadStart_ Comment More infoAdvertise with us Next Article C# | Thread(ThreadStart) Constructor A ankita_saini Follow Improve Article Tags : C# CSharp Multithreading CSharp Thread Class Similar Reads C# | Thread(ParameterizedThreadStart) Constructor Thread(ParameterizedThreadStart) Constructor is used to initialize a new instance of the Thread class. It defined a delegate which allows an object to pass to the thread when the thread starts. This constructor gives ArgumentNullException if the parameter of this constructor is null. Syntax: public 2 min read C# Constructors Constructor is a special method of the class which gets automatically invoked whenever an instance of the class is created. Constructors in C# are fundamental components of object-oriented programming. Like methods, It contains the collection of instructions that are executed at the time of Object c 5 min read C# Types of Threads Multithreading is one of the core features in C# that allows multiple tasks to be performed concurrently. Threads allow your application to run multiple tasks simultaneously, improving performance, and resource utilization. In C#, there are two types of threads.Foreground ThreadsBackground ThreadsNo 4 min read How to Create Threads in C#? Multithreading enables concurrent task execution in C#. It improves performance and responsiveness. We can create threads using the System.Threading namespace. With the help of Threads, we can achieve multitasking and can define their behavior using different methods provided by the Thread Class. Ex 6 min read Thread.CurrentThread Property in C# A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as CurrentThread to check the current running thread. Or in other words, the value of this property indicates the current running thread. Syntax: public static Thread CurrentThr 2 min read Like