2011年5月10日
摘要: 线程池中的所有线程都是后台线程,如果程序中的所有前台程序都结束了,那么所有的后台线程将会停止。线程池中的线程不能修改为前台线程使用范例如下:usingSystem;usingSystem.Threading;namespaceWrox.ProCSharp.Threading{classProgram{staticvoidMain(){intnWorkerThreads;intnCompletionPortThreads;ThreadPool.GetMaxThreads(outnWorkerThreads,outnCompletionPortThreads);Console.WriteLine( 阅读全文
posted @ 2011-05-10 22:01 jackdesk 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 实现很简单就不做说明了usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading;namespacebackGroundThread{classProgram{staticvoidMain(string[]args){Threadtl=newThread(ThreadMain);tl.Name="123";tl.IsBackground=true;//设置为后台线程tl.Start();Console.WriteLine("M 阅读全文
posted @ 2011-05-10 21:34 jackdesk 阅读(168) 评论(0) 推荐(0) 编辑