前言
Java中的線程池已經不是什麼神祕的技術了,相信在看的讀者在項目中也都有使用過。關於線程池的文章也是數不勝數,我們站在巨人的肩膀上來再次梳理一下。
讀完此文你將學到:
ThreadPoolExecutor
中常用參數有哪些?ThreadPoolExecutor
中線程池狀態和線程數量如何存儲的?ThreadPoolExecutor
有哪些狀態,狀態之間流轉是什麼樣子的?ThreadPoolExecutor
任務處理策略?ThreadPoolExecutor
常用的拒絕策略有哪些?Executors
工具類提供的線程池有哪些?有哪些缺陷?ThreadPoolExecutor
核心線程池中線程預熱功能?ThreadPoolExecutor
中創建的線程如何被複用的?ThreadPoolExecutor
中關閉線程池的方法shutdown
與shutdownNow
的區別?ThreadPoolExecutor
中存在的一些擴展點?ThreadPoolExecutor
支持動態調整核心線程數、最大線程數、隊列長度等一些列參數嗎?怎