How to Schedule a Thread for Execution in C#? Last Updated : 06 Feb, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report In C#, we can schedule a thread for execution using the Thread class. The Thread.Start() method is responsible for scheduling a thread, allowing it to run when system resources are available. This method can be overloaded to pass parameters to the thread. Also, the Thread.Sleep() method can be used to pause execution for a specified duration. 1. Using Thread.Start()The Start() method changes the state of the current instance to Running, allowing the thread to execute its assigned task.Syntax:public void Start();Exceptions:ThreadStateException: If the thread has already been started.OutOfMemoryException: If there is not enough memory available to start a thread.Example: C# // C# program to illustrate the // use of Start() method using System; using System.Threading; public class Geeks { public static void Main() { // Creating and initializing a thread Thread thr = new Thread(new ThreadStart(Job)); // Start the execution of Thread // Using Start() method thr.Start(); } public static void Job() { for (int i = 0; i < 4; i++) { Console.WriteLine(i); } } } Output0 1 2 3 2. Using Thread.Start(Object)This method starts the execution of a thread and allows passing an object containing data to be used by the method the thread executes.Syntax:public void Start(object parameter);Exceptions:ThreadStateException: If the thread has already been started.OutOfMemoryException: If there is not enough memory available to start a thread.InvalidOperationException: If the thread was created using a ThreadStart delegate instead of a ParameterizedThreadStart delegate.Example: C# // C# program to illustrate the // use of Start(Object) method using System; using System.Threading; class Geeks { public static void Main() { // Creating object of Geeks class Geeks obj = new Geeks(); // Creating and initializing threads Thread thr1 = new Thread(obj.Job1); Thread thr2 = new Thread(Job2); // Start the execution of Thread // Using Start(Object) method thr1.Start(01); thr2.Start("Hello"); } public void Job1(object value) { Console.WriteLine("Data of Thread 1 is: {0}", value); } public static void Job2(object value) { Console.WriteLine("Data of Thread 2 is: {0}", value); } } OutputData of Thread 1 is: 1 Data of Thread 2 is: Hello 3. Using Thread.Sleep()The Thread.Sleep() method pauses the execution of the current thread for a specified duration, allowing other threads to execute.Syntax:public static void Sleep(int millisecondsTimeout);Example: C# // C# Program to illustrate the // Thread.Sleep method using System; using System.Threading; class Geeks { static void Main() { Console.WriteLine("Starting..."); Thread.Sleep(300); Console.WriteLine("300 milliseconds have passed."); } } OutputStarting... 300 milliseconds have passed. Comment More infoAdvertise with us Next Article How to Schedule a Thread for Execution in C#? A ankita_saini Follow Improve Article Tags : C# CSharp-method 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# | How to check current state of a thread 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 prop 2 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 How to Thread Lock Work in C#? C# makes the concurrent execution of a code possible with the help of threads. The namespace System. Threading which is pre-built in C# supports the use of threads. Typically we create threads for the concurrent execution of a program. But in certain cases we may not want our program to be run concu 4 min read Suspending the current thread for the specified amount of time in C# In C#, a Sleep() method temporarily suspends 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. There are two methods in the overload list of Thread.Sleep Method as follows: Sleep(Int32) S 3 min read Like