using System;
using System.Threading;namespace ConsoleApplication1
{
    class SimpleThreadDemo
    {
        static void Main(string[] args)
        {
        Thread t1 = new Thread(new ThreadStart(TaskOne));
        Thread t2 = new Thread(new ThreadStart(TaskTwo));
            t1.Start();
            t2.Start();
            t2.Priority = ThreadPriority.Highest;
        }
        static void TaskOne()
        {
        for(int count = 1; count <= 10 ; count++)
        {
                Console.WriteLine(count * 2);
        }
        }
        static void TaskTwo()
        {
            for (int i = 5000; i >4990 ; i--)
            {
                Console.WriteLine(i);
            }
        }
    }}

解决方案 »

  1.   

    t2.Priority = ThreadPriority.Highest;
                t1.Start();
                t2.Start();
    换个位置,不然优先级还没设,线程1都已经开始跑了
      

  2.   

    程序没有问题..你不妨把循环的次数加大一下应该就能看出效果了..比如:count <= 100,i >4900..即都循环100次..
      

  3.   

    循环次数太少,线程基本上都在一个时间片内就执行完成,虽然线程2的优先级高,但也有可能线程1先抢占到Cpu,执行一个时间片就结束了..优先级高只能说在一定时间内抢占到Cpu的概率大,所以测试时间应该足够长..