随笔分类 -  并发

摘要:https://www.cnblogs.com/three-fighter/p/14396208.html 阅读全文
posted @ 2021-12-30 09:26 Zhbeii 阅读(15) 评论(0) 推荐(0) 编辑
摘要:![image](https://img2020.cnblogs.com/blog/2138338/202112/2138338-20211223171805261-114536239.png) 阅读全文
posted @ 2021-12-23 22:45 Zhbeii 阅读(14) 评论(0) 推荐(0) 编辑
摘要:正确的停止线程 使用interrupu来通知,而不是强制 interrupu仅仅是通知,线程本身具有决定权是否终止,原因:线程本身了解自己的运行状态,即:自己的任务是不是已经完成了,所以把决定权交给线程自己 public class RightWayStop implements Runnable 阅读全文
posted @ 2021-12-22 23:54 Zhbeii 阅读(26) 评论(0) 推荐(0) 编辑
摘要:start()与run()的比较 public class StartAndRunMethod { public static void main(String[] args) { Runnable runnable = () ->{ System.out.println(Thread.curren 阅读全文
posted @ 2021-12-22 23:33 Zhbeii 阅读(27) 评论(0) 推荐(0) 编辑
摘要:public class wrongways { public static void main(String[] args) { ExecutorService executorService = Executors.newCachedThreadPool(); for(int i = 0;i < 阅读全文
posted @ 2021-12-22 21:49 Zhbeii 阅读(64) 评论(0) 推荐(0) 编辑
摘要:实现Runnable接口 public class RunnableStyle implements Runnable { public static void main(String[] args) { Thread thread = new Thread(new RunnableStyle()) 阅读全文
posted @ 2021-12-22 21:34 Zhbeii 阅读(51) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/xyls12345/article/details/26256693 阅读全文
posted @ 2021-11-17 22:22 Zhbeii 阅读(8) 评论(0) 推荐(0) 编辑

more_horiz
keyboard_arrow_up dark_mode palette
选择主题
点击右上角即可分享
微信分享提示