কম্পিউটার টিউটোরিয়াল

C#-এ করেন্ট থ্রেডের প্রায়োরিটি দেখানো


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

  1. জাভা প্রোগ্রাম: একটি সংখ্যার ফ্যাক্টর (Factors) ডিসপ্লে করা

  2. জাভা প্রোগ্রাম: ফিবোনাচ্চি সিরিজ প্রদর্শন করার পদ্ধতি

  3. জাভা মাল্টিথ্রেডিং-এ থ্রেড প্রায়োরিটি (Thread Priority)

  4. জাভাতে থ্রেড প্রায়োরিটির গুরুত্ব