C# | How to check current state of a thread Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as ThreadState to check the current state of the thread. The initial state of a thread is Unstarted state. Syntax: public ThreadState ThreadState{ get; } Return Value: This property returns the value that indicates the state of the current thread. Below programs illustrate the use of ThreadState property: Example 1: CSharp // C# program to illustrate the // use of ThreadState property using System; using System.Threading; public class GFG { // Main Method static public void Main() { Thread thr; // Get the reference of main Thread // Using CurrentThread property thr = Thread.CurrentThread; // Display the current state // of the main thread Console.WriteLine("The name of the current state of the Main " + "thread is: {0}", thr.ThreadState); } } Output: The name of the current state of the main thread is: Running Example 2: CSharp // C# program to illustrate the // use of ThreadState property using System; using System.Threading; public class GFG { // Main method public static void Main() { // Creating and initializing threads Thread TR1 = new Thread(new ThreadStart(job)); Thread TR2 = new Thread(new ThreadStart(job)); Console.WriteLine("ThreadState of TR1 thread"+ " is: {0}", TR1.ThreadState); Console.WriteLine("ThreadState of TR2 thread"+ " is: {0}", TR2.ThreadState); // Running state TR1.Start(); Console.WriteLine("ThreadState of TR1 thread "+ "is: {0}", TR1.ThreadState); TR2.Start(); Console.WriteLine("ThreadState of TR2 thread"+ " is: {0}", TR2.ThreadState); } // Static method public static void job() { Thread.Sleep(2000); } } Output: ThreadState of TR1 thread is: Unstarted ThreadState of TR2 thread is: Unstarted ThreadState of TR1 thread is: Running ThreadState of TR2 thread is: WaitSleepJoin Reference: https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.threadstate?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article C# Lifecycle and States of a Thread A ankita_saini Follow Improve Article Tags : C# CSharp Multithreading CSharp Thread Class Similar Reads How to Terminate a Thread in C#? In C#, threads are used to achieve tasks concurrently, a fundamental feature in multithreading and parallel programming. However, there are scenarios where we need to terminate a thread. There are different ways to terminate a thread and in this article, we will discuss those ways with their code im 6 min read C# Lifecycle and States of a Thread In C#, threads enable the concurrent execution of tasks, it improves application performance and responsiveness. Understanding the lifecycle and states of a thread is essential for managing and synchronizing threads efficiently. A thread in C# can exist in one of the following states at any given ti 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 C# | Check if a thread belongs to managed thread pool or not A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as IsThreadPoolThread to check if the thread belongs to the managed thread pool or not. Syntax: public bool IsThreadPoolThread { get; } Return Value: This property returns true 2 min read How to Check Whether a Thread is Alive or Not in C#? A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as IsAlive to check if the thread is alive or not. In other words, the value of this property indicates the current execution of the thread.Example 1: This example demonstrates 3 min read How to check whether a thread is a background thread or not in C# As we know that thread is created and managed by the Thread class. So, the Thread class provides a property known as IsBackground property to check whether the given thread is running in the background or in the foreground. If the value of IsBackground is set to be true, then it means the thread is 3 min read Like