zavier / blogs-comments

博客评论
0 stars 0 forks source link

自定义扩展线程池 | 编码之路 #20

Open zavier opened 4 years ago

zavier commented 4 years ago

https://zhengw-tech.com/2019/10/27/customize-thread-pool-executor/#more

线程池的基本使用Executors框架提供的创建线程池的方法 123456// 固定线程数量的线程池Executors.newFixedThreadPool(5);// 对于添加的任务,如果有线程可用则使用其执行,否则就创建新线程Executors.newCachedThreadPool();// 创建只有一个线程的线程池Executors.newSingleThreadExecutor(); 它