Thread priorities: ThreadPriority.Highest, ThreadPriority.Lowest : Thread Priority « Thread « C# / CSharp Tutorial






using System;
using System.Threading;

class MainClass
{
  public static void Countdown() 
  {
    for (int i = 10; i > 0; i--) 
    {
      Console.Write(i.ToString() + " ");
    }
  }

  public static void Main() 
  {
    Thread t2 = new Thread(new ThreadStart(Countdown));

    t2.Priority=ThreadPriority.Highest;

    Thread.CurrentThread.Priority=ThreadPriority.Lowest;

    t2.Start();
  }
}
10 9 8 7 6 5 4 3 2 1








20.7.Thread Priority
20.7.1.Thread priorities.
20.7.2.User Thread: Name, ApartmentState, IsAlive, Priority, ThreadState
20.7.3.Thread priorities: ThreadPriority.Highest, ThreadPriority.Lowest