Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

Lifecycle and States of a Thread in C#

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

A thread in C# at any point of time exists in any one of the following states. A thread lies only in one of the shown states at any instant:

Flow Chart:


Life Cycle of a thread


  1. Unstarted state: When an instance of a Thread class is created, it is in the unstarted state, means the thread has not yet started to run when the thread is in this state. Or in other words Start() method is not called.
Thread thr = new Thread(); 
  1. Here, thr is at unstarted state.
  2. Runnable State: A thread that is ready to run is moved to runnable state. In this state, a thread might actually be running or it might be ready to run at any instant of time. It is the responsibility of the thread scheduler to give the thread, time to run. Or in other words, the Start() method is called. 
  3. Running State: A thread that is running. Or in other words, the thread gets the processor.
  4. Not Runnable State: A thread that is not executable because
    • Sleep() method is called.
    • Wait() method is called.
    • Due to I/O request.
    • Suspend() method is called.
  5. Dead State: When the thread completes its task, then thread enters into dead, terminates, abort state.


Implementing Thread States in C#

In C#, to get the current state of the thread, use ThreadState or IsAlive property provided by the Thread class.

public ThreadState ThreadState{ get; }


public bool IsAlive { get; }

Thread class provides different types of methods to implement the states of the threads. 

  • Sleep() method is used to temporarily suspend the current execution of the thread for specified milliseconds, so that other threads can get the chance to start the execution, or may get the CPU for execution.
  • Join() method is used to make all the calling thread to wait until the main thread, i.e. joined thread complete its work.
  • Abort() method is used to abort the thread.
  • Suspend() method is called to suspend the thread.
  • Resume() method is called to resume the suspended thread.
  • Start() method is used to send a thread into runnable State.



// C# program to illustrate the
// states of the thread
using System;
using System.Threading;
public class MyThread {
    // Non-Static method
    public void thread()
        for (int x = 0; x < 2; x++) {
            Console.WriteLine("My Thread");
public class ThreadExample {
    // Main method
    public static void Main()
        // Creating instance for
        // mythread() method
        MyThread obj = new MyThread();
        // Creating and initializing
        // threads Unstarted state
        Thread thr1 = new Thread(new ThreadStart(obj.thread));
        Console.WriteLine("ThreadState: {0}",
        // Running state
        Console.WriteLine("ThreadState: {0}",
        // thr1 is in suspended state
        Console.WriteLine("ThreadState: {0}",
        // thr1 is resume to running state
        Console.WriteLine("ThreadState: {0}",


ThreadState: Unstarted
ThreadState: Running
ThreadState: SuspendRequested
ThreadState: Running
My Thread
My Thread

Explanation: The above example shows the different states of thr1 thread. These states of a thr1 thread are determined by using the ThreadState property of the Thread class. Also, we use Suspend() and Resume() method to suspend the current execution of the thread and resume the suspended thread by using the Resume method.

My Personal Notes arrow_drop_up
Last Updated : 30 Sep, 2021
Like Article
Save Article
Similar Reads