1、newCachedThreadPool 這種線程池比較靈活,也就是說它的池里的線程數(shù)量并不是固定的,理論上可以無限大,任務(wù)不需要排隊,如果有空閑的線程,則復(fù)用,無則新建線程。 1 2 3 4 5 6 7 8 9 ExecutorService cachedThreadPool = Executors.newCachedThreadPool(); cachedThreadPool.execute(newRunnable() { @Override...
www.dbjr.com.cn/article/1195...htm 2025-5-27