摘要:
一、异步委托开启线程 public static void Main(string[] args){ Action<int,int> a=add; a.BeginInvoke(3,4,null,null);//前两个是add方法的参数,后两个可以为空 Console.WriteLine("main( 阅读全文
摘要:
1、简介 为什么MS要推出Task,而不推Thread和ThreadPool,以下是我的见解: (1)、Thread的Api并不靠谱,甚至MS自己都不推荐,原因,它将整个Thread类都不开放给Windows Sotre程序,且它的Api过于强大,如果在程序中过度使用,维护的成本太高,想想代码中充斥 阅读全文
摘要:
1、线程创建示例 Thread thread = new Thread(new ThreadStart(getpic)); thread.Start(); private void showmessage() { Console.WriteLine("hello world"); } 2、带一个参数 阅读全文