
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
C# Program to display priority of Thread
To show the priority of the thread in C#, use the Priority property.
Firstly, use the currentThread property to display information about a thread −
Thread thread = Thread.CurrentThread;
Now use the thread.Priority property to display the priority of the thread −
thread.Priority
Example
Let us see the complete code to show the thread’s priority in C#.
using System; using System.Threading; namespace Demo { class MyClass { static void Main(string[] args) { Thread thread = Thread.CurrentThread; thread.Name = "My Thread"; Console.WriteLine("Thread Priority = {0}", thread.Priority); Console.ReadKey(); } } }
Output
Thread Priority = Normal
- Related Articles
- C# Program to display name of Current Thread
- Importance of Thread Priority in Java?
- Change Thread Priority in Java
- Java Thread Priority in Multithreading
- How to get current thread priority in android?
- C++ Program to Implement Priority Queue
- How to display the name of the Current Thread in C#?
- C++ Program for Priority Scheduling
- How to use set the priority for a thread in android?
- C# Program to Check status of Current Thread
- C# Program to implement Sleep Method Of Thread
- C# Program to Kill a Thread
- C# Program to Pause a Thread
- C# Program to create a Simple Thread
- C# Program to Create a Thread Pool

Advertisements