Example

using System;
using System.Threading;

namespace Samples
{
  public class ThreadPrioritySample
  {
    public static void StartHere()
    {
      ThreadPriority[] tps =
                 {ThreadPriority.AboveNormal,
                  ThreadPriority.BelowNormal,
                  ThreadPriority.Normal,
                  ThreadPriority.Highest,
                  ThreadPriority.Lowest};
      Thread t = Thread.CurrentThread;
      foreach(ThreadPriority tp in tps)
      {
        t.Priority = tp;
        Console.WriteLine("ThreadPriority: {0}",
                          t.Priority);
      }
    }
    public static void Main()
    {
      Thread t = new Thread(
                   new ThreadStart(StartHere));
      Console.WriteLine("Main starting");
      t.Start();
      t.Join();
      Console.WriteLine("Main finishing");
    }
  }
}
The output is
 Main starting ThreadPriority: AboveNormal ThreadPriority: BelowNormal ThreadPriority: Normal ThreadPriority: Highest ThreadPriority: ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.