Executors.newFixedThreadPool
时间: 2023-10-25 22:02:48 浏览: 111
引用中的源码展示了`Executors`类中的`newFixedThreadPool`方法的实现。该方法返回一个`ThreadPoolExecutor`对象,它是一个固定大小的线程池。通过参数可以指定线程池的大小,同时使用了`LinkedBlockingQueue`作为任务队列。中提到,`newFixedThreadPool`返回的`ThreadPoolExecutor`对象被`FinalizableDelegatedExecutorService`包装,而`newSingleThreadExecutor`返回的`ThreadPoolExecutor`对象也是被包装过的。这些包装类都实现了`ThreadPoolExecutor`接口。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Java 中 Executors.newSingleThreadExecutor() 与Executors.newFixedThreadPool(1)有什么区别](https://blog.csdn.net/lisheng19870305/article/details/118386729)[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^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文