Java线程池工具类Executors
1、newCachedThreadPool
2、newFixedThreadPool
3、newSingleThreadExecutor
4、newScheduledThreadPool
5、防止线程池修改
《阿⾥把把开发⼿册》不建议我们直接使⽤Executors类中的线程池,⽽是通过 ThreadPoolExecutor 的⽅式,这样的处理⽅式让写的同学需要更加明确线程池的运⾏规则,规避资源耗尽的⻛险
1、newCachedThreadPool
2、newFixedThreadPool
3、newSingleThreadExecutor
4、newScheduledThreadPool
5、防止线程池修改
《阿⾥把把开发⼿册》不建议我们直接使⽤Executors类中的线程池,⽽是通过 ThreadPoolExecutor 的⽅式,这样的处理⽅式让写的同学需要更加明确线程池的运⾏规则,规避资源耗尽的⻛险