随笔 - 33,  文章 - 0,  评论 - 0,  阅读 - 7205
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Remoting.Messaging; using System.Text; using System.Threading; 阅读全文
posted @ 2022-06-15 16:53 sbwynnss 阅读(382) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System. 阅读全文
posted @ 2022-06-13 21:38 sbwynnss 阅读(160) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; using System.T 阅读全文
posted @ 2022-06-12 15:53 sbwynnss 阅读(143) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2022-06-11 20:48 sbwynnss 阅读(241) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Sockets; using Sy 阅读全文
posted @ 2022-06-09 21:00 sbwynnss 阅读(14) 评论(0) 推荐(0) 编辑
摘要: class Program { static public void test() { Console.WriteLine("任务开始"); Thread.Sleep(3000); Console.WriteLine("任务结束"); } static void Main(string[] args 阅读全文
posted @ 2022-06-09 13:51 sbwynnss 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 只有一个前台线程在运行,应用程序的进程就在运行,如果多个前台线程在运行,但是Main方法结束了,应用程序的进程仍然是运行的,直到所有的前台线程完成其任务为止。 在默认情况下,用Thread类创建的线程是前台线程。线程池中的线程总是后台线程。在用Thread类创建线程的时候,可以设置IsBackgro 阅读全文
posted @ 2022-06-09 09:27 sbwynnss 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 使用线程池需要注意的事项: 1、线程池中的所有线程都是后台线程 。 如果进程的所有前台线程都结束了,所有的后台线程就会停止。 不能把入池的线程改为前台线程 。2、不能给入池的线程设置优先级或名称。3、入池的线程只能用于时间较短的任务。 如果线程要一直运行就应使用Thread类创建一个线程。 usin 阅读全文
posted @ 2022-06-08 20:36 sbwynnss 阅读(203) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2022-06-08 19:55 sbwynnss 阅读(44) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2022-06-08 16:40 sbwynnss 阅读(36) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示