标签:current ack 常用 str max item adp new manage
把开发过程中经常用到的一些代码段做个备份,下面代码内容是关于C#线程池操作演示的代码。static void Main(string[] args)
{
ThreadPool.SetMaxThreads(1000, 1000);
for (int i = 0; i < 10;i )
{
ThreadPool.QueueUserWorkItem(new WaitCallback(ShowMessage), string.Format("当前编号{0}",i));
}
Console.ReadLine();
}
static void ShowMessage(object x)
{
string current = string.Format("当前线程id为{0}", System.
Threading.Thread.CurrentThread.ManagedThreadId);
System.Threading.Thread.Sleep(1000);
Console.WriteLine(string.Format("{0},输入为{1}", current, x));
}
标签:current ack 常用 str max item adp new manage
原文地址:https://blog.51cto.com/14137088/2377653