http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece763104681254743801464849446289fc45f93130a1c187bf4ba53634a5996d27b1355e81702fdf14034774477a3de95c81cd2ace32238ff22230017913562c418dfdc3024d656924de8df1ae5adf14284ded8c4ab5044cb23120bf4e7fd2e1764cb78816526e3d78e39134863cbfa416fe828033e9e5357c742ee97397977f5e1a9585bc25ac7106580de35a73f62a262d0086b2353d13aa6785031319058568c534c0185ea2df05a795753c65fb2c9d6c7985ffdd9fd30e8edbba538e16af1c49aee07456725fa32bfdbbeb02a653515a9c0c962c025bd8afbcb38fe62a3072cbb4a075e7ccf1b83f48b4082684d84e37f8d233527581da9b3638f05676e41bf4e12a66bc462b0fe613dddfdec8f886431b8e8cf64768ebacf33a01d0a34ec565567bce02501&p=893bdd16d9c25fe609bd9b7847&user=baidu

解决方案 »

  1.   

    配个好电脑 省担心这个问题 cpu自己解决
      

  2.   

    高优先级的线程可以完全阻止低优先级的线程执行,因此在改变线程的优先级时要特别小心。线程的优先级可以定义为ThreadPriority枚举的值,即Highest、AboveNormal、Normal、BelowNormal和 Lowest。
      

  3.   

            //
            // Summary:
            //     The System.Threading.Thread can be scheduled after threads with AboveNormal
            //     priority and before those with BelowNormal priority. Threads have Normal
            //     priority by default.
            Normal = 2,
      

  4.   


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    namespace Ex_20_4
    {
        class Program
        {
            static void Main(string[] args)
            {
                MyThreadClass o1 = new MyThreadClass("hackcat1,我的优先级是:Normal!");
                Thread t1 = new Thread(o1.ThreadMain);
                t1.Priority = ThreadPriority.Normal;
                t1.Start();
                MyThreadClass o2 = new MyThreadClass("hackcat2,我的优先级是:Normal!");
                Thread t2 = new Thread(o2.ThreadMain);
                t2.Priority = ThreadPriority.Normal;
                t2.Start();
                MyThreadClass o3 = new MyThreadClass("hackcat3,我的优先级是:Normal!");
                Thread t3 = new Thread(o3.ThreadMain);
                t3.Priority = ThreadPriority.Normal;
                t3.Start();
                MyThreadClass o4 = new MyThreadClass("hackcat4,我的优先级是:Normal!");
                Thread t4 = new Thread(o4.ThreadMain);
                t4.Priority = ThreadPriority.Normal;
                t4.Start();
                Console.Read();
            }
        }
        public class MyThreadClass
        {
            private String Msg;
            public MyThreadClass(String Msg)
            {
                this.Msg = Msg;
            }
            public void ThreadMain()
            {
                Console.WriteLine("字段Msg的值是{0}", Msg);
            }
        }
    }
    跑了10来次,发现每次结果都不一样,这个是不是随机的?