随笔分类 -  C# / 多线程

摘要:https://blog.csdn.net/Upgrader/article/details/107774139 阅读全文
posted @ 2023-09-26 16:11 KevinSteven 阅读(19) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/DotnetNb/article/details/131075198 https://blog.csdn.net/m0_52559870/article/details/124980608 阅读全文
posted @ 2023-09-26 16:01 KevinSteven 阅读(122) 评论(0) 推荐(0)
摘要:lock:锁 个人理解主要是锁住代码块,只让一个线程执行锁住的代码块内容。其他线程必须等待当前的线程执行完代码块后,锁被释放了,才能进入执行。这样做的好处,可以在多线程中,保证线程安全。 以下是个人在网上搜集的一些关于lock的弊端: 1.性能开销:使用lock会造成额外的性能开销,因为每次进入和退 阅读全文
posted @ 2023-09-26 15:53 KevinSteven 阅读(422) 评论(0) 推荐(0)
摘要:Thread thread = new Thread(ThreadStartUpdate); thread.IsBackground = true; //设为后台运行 thread.Start(); //开始线程 private void ThreadStartUpdate() { string e 阅读全文
posted @ 2022-04-21 17:10 KevinSteven 阅读(40) 评论(0) 推荐(0)