摘要: 线程池的种类,区别和使用场景 newCachedThreadPool: 底层:返回ThreadPoolExecutor实例,corePoolSize为0;maximumPoolSize为Integer.MAX_VALUE;keepAliveTime为60L;unit为TimeUnit.SECONDS 阅读全文
posted @ 2019-06-02 16:59 木棉貮号 阅读(596) 评论(0) 推荐(0) 编辑
摘要: Spring 在多线程中,bean的注入问题 最近碰到了一个问题,使用SSM框架,在Service层需要另开一个线程,这个线程专门用来做一些操作,并将结果写入数据库中。但是在线程中使用@Resource或者@Autowired注入全部为NULL, 原来是Spring不能在线程中注入。 网上的主要解决 阅读全文
posted @ 2019-06-02 16:31 木棉貮号 阅读(2430) 评论(1) 推荐(0) 编辑