C#-এ থ্রেডের প্রায়োরিটি দেখাতে Priority প্রপার্টি ব্যবহার করুন।
প্রথমে CurrentThread প্রপার্টি ব্যবহার করে থ্রেডের তথ্য নিন:
Thread thread = Thread.CurrentThread;
এখন thread.Priority প্রপার্টি ব্যবহার করে প্রায়োরিটি দেখান:
thread.Priority
সম্পূর্ণ উদাহরণ
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();
}
}
}
আউটপুট
Thread Priority = Normal
প্রায়োরিটি লেভেল: Highest, AboveNormal, Normal, BelowNormal, Lowest