C# Thread Priority in Multithreading Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In a multithreaded environment, each thread has a priority that determines how frequently the thread is allocated CPU resources by the operating system. The Thread.Priority property in C# is used to set or get the priority of a thread.A programmer can explicitly assign a priority to a thread using the Priority property.By default, a thread's priority is set to Normal.The operating system handles thread scheduling, but priorities influence how threads are executed.Setting priorities incorrectly can lead to thread starvation, where lower-priority threads may not get enough CPU time.A high-priority thread does not guarantee that it will execute before a low-priority thread because of context switching and other OS-level scheduling mechanisms.The thread priority always depends on the process priority (the parent container).Thread Priority LevelsThe ThreadPriority enum under the System.Threading namespace specifies the following priority levels:Priority LevelDescriptionValueHighestHighest priority for a thread.4AboveNormalHigher than Normal priority.3Normal (Default)Default priority.2BelowNormalLower than Normal priority.1LowestLowest priority for a thread.0Syntax:public ThreadPriority Priority{ get; set; }Exceptions:ThreadStateException: If the thread has reached a final state, such as Aborted.ArgumentException: If the value specified for a set operation is not a valid ThreadPriority value.Example 1: This example demonstrates how to set and get the priority of threads. C# // C# program to illustrate how to // set and get the priority of threads using System; using System.Threading; class Geeks { static public void Main() { // Creating and initializing threads Thread T1 = new Thread(work); Thread T2 = new Thread(work); Thread T3 = new Thread(work); // Set the priority of threads T2.Priority = ThreadPriority.Highest; T3.Priority = ThreadPriority.BelowNormal; T1.Start(); T2.Start(); T3.Start(); // Display the priority of threads Console.WriteLine("The priority of T1 is: {0}", T1.Priority); Console.WriteLine("The priority of T2 is: {0}", T2.Priority); Console.WriteLine("The priority of T3 is: {0}", T3.Priority); } public static void work() { // Sleep for 100 milliseconds Thread.Sleep(100); } } OutputThe priority of T1 is: Normal The priority of T2 is: Highest The priority of T3 is: BelowNormal Example 2: This example demonstrates how thread priority can influence thread execution. C# // C# program to illustrate the // Priority property of Thread class using System; using System.Threading; class Geeks { static public void Main() { // Creating and initializing threads Thread T1 = new Thread(work1); Thread T2 = new Thread(work2); // Set the priority of threads // Here T2 thread executes first // because the Priority of T2 is // highest as compare to T1 thread T1.Priority = ThreadPriority.Lowest; T2.Priority = ThreadPriority.Highest; T1.Start(); T2.Start(); } public static void work1() { Console.WriteLine("T1 thread is working.."); } public static void work2() { Console.WriteLine("T2 thread is working.."); } } OutputT1 thread is working.. T2 thread is working.. Comment More info A ankita_saini Follow Improve Article Tags : C# CSharp Multithreading CSharp Thread Class Explore IntroductionC# Tutorial 4 min read Introduction to .NET Framework 6 min read C# .NET Framework (Basic Architecture and Component Stack) 6 min read C# Hello World 2 min read Common Language Runtime (CLR) in C# 4 min read FundamentalsC# Identifiers 2 min read Data Types in C# 6 min read C# Variables 4 min read C# Literals 5 min read Operators in C# 7 min read C# Keywords 5 min read Control StatementsC# Decision Making (if, if-else, if-else-if ladder, nested if, switch, nested switch) 5 min read C# Switch Statement 4 min read Loops in C# 4 min read C# Jump Statements (Break, Continue, Goto, Return and Throw) 4 min read OOP ConceptsClass and Objects in C# 4 min read Constructors in C# 5 min read C# Inheritance 3 min read Encapsulation in C# 2 min read C# Abstraction 4 min read MethodsMethods in C# 4 min read Method Overloading in C# 4 min read C# | Method Parameters 7 min read Method Overriding in C# 7 min read Anonymous Method in C# 3 min read ArraysArrays in C# 6 min read Jagged Arrays in C# 4 min read Array Class in C# 5 min read How to Sort an Array in C# | Array.Sort() Method Set - 1 8 min read How to find the rank of an array in C# 2 min read ArrayListArrayList in C# 6 min read C# ArrayList Class 7 min read C# | Array vs ArrayList 2 min read StringStrings in C# 6 min read C# Verbatim String Literal - @ 5 min read C# String Class 9 min read C# StringBuilder 4 min read C# String vs StringBuilder 3 min read TupleC# Tuple 7 min read C# Tuple Class 3 min read C# ValueTuple 7 min read C# ValueTuple Struct 4 min read IndexersC# Indexers 4 min read C# Multidimensional Indexers 5 min read C# - Overloading of Indexers 3 min read Like