ThreadPoolExecutor和Executors
时间: 2023-10-12 18:01:37 浏览: 113
ThreadPoolExecutor和Executors是Java中与线程池相关的两个类。
ThreadPoolExecutor是一个可扩展的线程池实现类,它实现了ExecutorService接口。我们可以通过自己创建ThreadPoolExecutor对象来自定义线程池的参数,例如线程池的大小、任务队列的类型等。ExecutorService接口定义了线程池的常用方法,例如提交任务、关闭线程池等。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ThreadPoolExecutor和Executors](https://blog.csdn.net/qq_43430343/article/details/120808594)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Executors和ThreadPoolExecutor详解](https://blog.csdn.net/amosjob/article/details/116518538)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文