![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
多线程学习
文章平均质量分 92
草坪头
这个作者很懒,什么都没留下…
展开
-
多线程学习之锁的学习
多线程学习之锁的学习一、两种锁:reentrantlock和synchronize二、reentrantlock的运用三、synchronize的运用四、两者的区别相同点:不同点:五、死锁的查找指令![在这里插入图片描述](https://img-blog.csdnimg.cn/20200213202201508.png?x-oss-process=image/watermark,type_ZmF...原创 2020-02-13 20:22:54 · 133 阅读 · 0 评论 -
多线程学习之创建线程的方法
多线程学习之创建线程的方法一、通过runnable接口创建线程二、继承Thread类创建线程三、使用Callable和FutureTask创建线程四、将Runnable或Callable放到线程池ExecutorsService中执行 一、通过runnable接口创建线程 1.重写runnable的run方法 2.使用runnable对象构造Thread对象 3.启动线程 二、继承Thread类...原创 2020-02-03 21:21:12 · 158 阅读 · 0 评论 -
多线程学习之Callable接口和Future类
多线程学习之Callable接口和Future类一、将启动多线程类封装在线程类中,实现Thread类,重写run方法满足的需求二、编写每个线程类的执行任务,实现Callable接口,重写call方法满足自己的需求三、主方法中启动run方法四、总结1.Thread类中,run方法和start方法的区别。run方法是由当前线程执行Thread类中的run方法体中的代码。须等待run方法完成后,才能执行...原创 2019-09-29 21:10:28 · 149 阅读 · 0 评论