

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to display priority of Thread
<p style="">To show the priority of the thread in C#, use the <strong>Priority</strong> property.</p><p style="">Firstly, use the <strong>currentThread</strong> property to display information about a thread −</p><pre class="result notranslate">Thread thread = Thread.CurrentThread;</pre><p style="">Now use the <strong>thread.Priority</strong> property to display the priority of the thread −</p><pre class="result notranslate" style="">thread.Priority</pre><h2 style="">Example</h2><p style="">Let us see the complete code to show the thread’s priority in C#.</p><p style=""><a class="demo" href="http://tpcg.io/7eO5qi" rel="nofollow" target="_blank">Live Demo</a></p><pre class="result notranslate" style="">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(); } } }</pre><h2 style="">Output</h2><pre class="result notranslate">Thread Priority = Normal</pre>
- Related Questions & Answers
- Importance of Thread Priority in Java?
- Change Thread Priority in Java
- Java Thread Priority in Multithreading
- C# Program to display name of Current Thread
- How to get current thread priority in android?
- How to use set the priority for a thread in android?
- C++ Program to Implement Priority Queue
- C++ Program for Priority Scheduling
- How to display the name of the Current Thread in C#?
- C# Program to Check status of Current Thread
- C# Program to implement Sleep Method Of Thread
- Display thread's information in Java
- C# Program to Kill a Thread
- C# Program to Pause a Thread
- How to display all stack frames of the current thread in Java 9?
Advertisements