码迷,mamicode.com
首页 > 编程语言 > 详细

C#相关的线程

时间:2018-08-12 23:38:03      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:for   art   线程池   fun   获取   ota   相关   read   star   

for(int i =0;i<=5;i++)
{
    Thread th = new Thread(Dotaskfunction());
    th.Start();  
}
for(int i=0;i<=5;i++)
{
   Task.Run(()=>{Dotaskfunction();});
}

Task是C#线程的一种,与thread的不同在于,task执行任务时会从线程池中获取空闲的线程。

C#相关的线程

标签:for   art   线程池   fun   获取   ota   相关   read   star   

原文地址:https://www.cnblogs.com/mathyk/p/9465336.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!