Java 多线程
文章平均质量分 85
Logan_addoil
种一棵树最好的时间是十年前,其次是现在
展开
-
CompletableFuture异步编排
捕获异步任务异常:java.util.concurrent.CompletionException: java.lang.RuntimeException: whenComplete抛出异常。捕获异步任务异常:java.util.concurrent.CompletionException: java.lang.RuntimeException: whenComplete抛出异常。runAfterBoth()无返回结果,可得到任务1和任务2结果:任务1和任务2任一抛出异常,任务3不执行;转载 2022-11-30 10:47:55 · 126 阅读 · 0 评论 -
ThreadPoolExecutor源码浅析
ThreadPoolExecutor的介绍在今天主要看execute执行流程原创 2022-11-26 18:00:14 · 540 阅读 · 0 评论 -
Executors和ThreadPoolExecutor线程池
问题来源:阿里巴巴开发手册并发编程这块写有一条:线程池不允许使用Executor去创建,而是通过ThreadPoolExecutor的方式创建.线程池的优点:减少内存资源的消耗.提高请求处理速度避免出现OOMExecutor创建线层的方式:创建返回 ThreadPoolExecutor 对象创建返回 ScheduleThreadPoolExecutor对象创建返回ForkJoinP...原创 2020-06-30 12:31:21 · 638 阅读 · 2 评论 -
ReentarantLock源码浅析
ReentrantLock: 就是一个互斥锁,可以让多线程执行期间,只有一个线程在执行原创 2022-11-26 17:45:31 · 486 阅读 · 0 评论