java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy
时间: 2023-10-17 16:00:38 浏览: 141
java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy是Java中的一个线程池拒绝策略。当任务被提交给线程池,但线程池已满并且无法接受更多的任务时,ThreadPoolExecutor$CallerRunsPolicy允许调用线程直接执行被拒绝的任务,而不会抛出异常。这种策略的作用是保证任务的执行,虽然可能会导致调用线程的性能下降,因为调用线程需要执行被拒绝的任务。这种策略适用于需要保证任务执行的场景,即使在高负载情况下也不会丢失任务。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Java 线程池ThreadPoolExecutor](https://blog.csdn.net/abing37/article/details/4506759)[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: 100%"]
[ .reference_list ]
阅读全文