from:http://topic.csdn.net/u/20090314/20/564e9211-bb5e-4570-b73c-4fcf30350a30.html

以下这2段多线程代码有什么区别,哪种能更好的异步执行
第一段
  Thread thread_copyormove = new Thread(new ThreadStart(ThreadMain));
  thread_copyormove.IsBackground = true;
  thread_copyormove.Start();
第二段
  Thread thread_copyormove = new Thread(ThreadMain);
  thread_copyormove.IsBackground = true;
  thread_copyormove.Start();
主要就是第一句代码有无new ThreadStart()
-----------------------------------------------------------
没有什么区别,以前c#2.0还不支持直接写方法呢,这是因为c#3.0的编译器强大了,支持直接写方法名,或者delegate{},编译后的结果应该是一样的。

相关文章:

  • 2021-08-14
  • 2021-12-29
  • 2021-06-14
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2022-01-27
  • 2021-06-09
  • 2022-03-05
相关资源
相似解决方案