using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace ThreadPriorityExample { class Program { static void MethodOne() { long val = 1; for (int i = 1; i < int.MaxValue; i++ ) { val++; } Console.WriteLine("First thread ended: " + val); } static void MethodTwo() { long val = 1; for (int i = 1; i < int.MaxValue; i++) { val++; } Console.WriteLine("Second thread ended: " + val); } static void Main(string[] args) { Thread one = new Thread(MethodOne); Thread two = new Thread(MethodTwo); one.Priority = ThreadPriority.Lowest; two.Priority = ThreadPriority.Highest; one.Start(); two.Start(); one.Join(); two.Join(); Console.ReadKey(); } } }