Bookcold

导航

C#线程编程

独立线程的运行和控制:

const int Repetitions = 1000; public static void ThreadStart() { System.Threading.Thread thread = new System.Threading.Thread(DoWork); thread.Start(); for (int count = 0; count < Repetitions; count++) { Console.Write('-'); } thread.Join(); } private static void DoWork() { for (int count = 0; count < Repetitions; count++) { Console.Write('.'); } }

向线程传递参数:

const int Repetitions [...]

posted on 2010-03-29 21:17  bookcold  阅读(123)  评论(0)    收藏  举报