摘要: 1. 通过Executors创建线程池的弊端 在创建线程池的时候,大部分人还是会选择使用Executors去创建。 下面是创建定长线程池(FixedThreadPool)的一个例子,严格来说,当使用如下代码创建线程池时,是不符合编程规范的。 ExecutorService fixedThreadPo 阅读全文
posted @ 2021-06-09 14:29 姚春辉 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 首先用的是new Thread public void doSummaryJob() throws Exception { try{ HandlerMappingSummaryJobRunnable handlerMappingSummaryJobRunnable = new HandlerMapp 阅读全文
posted @ 2021-06-09 14:22 姚春辉 阅读(321) 评论(0) 推荐(0) 编辑