static void Main(string[] args)
 {
     ThreadDispatcher td=new ThreadDispatcher();
     Runner r1 = td.CreateHpThread(d=>OnHpThreadRun(d,1));
     Runner r2 = td.CreateHpThread(d => OnHpThreadRun(d, 2));
     Runner l1 = td.CreateLpThread(d => Console.WriteLine("Running low priority thread 1"));
     Runner l2 = td.CreateLpThread(d => Console.WriteLine("Running low priority thread 2"));
     Runner l3 = td.CreateLpThread(d => Console.WriteLine("Running low priority thread 3"));
     l1.Start();
     l2.Start();
     l3.Start();
     r1.Start();
     r2.Start();
     Console.ReadLine();
     l1.Stop();
     l2.Stop();
     l3.Stop();
     r1.Stop();
     r2.Stop();
 }