publicclassThreadPoolExecutorTest{
privatestatic ThreadPoolExecutor pool =newThreadPoolExecutor(2,4,60, TimeUnit.SECONDS,newArrayBlockingQueue<>(10),newThreadPoolExecutor.AbortPolicy());publicstaticvoidmain(String[] args)throws InterruptedException {
for(int i =1; i <=14; i++){
Callable<Boolean> task =createTask(i);
pool.submit(task);
System.out.println("after task:"+ i +" submitted, current active count: "+ pool.getActiveCount()+", size of queue: "+ pool.getQueue().size());}
System.out.println
线程池执行过程一 直接上例子二 饱和策略一 直接上例子public class ThreadPoolExecutorTest { private static ThreadPoolExecutor pool = new ThreadPoolExecutor(2, 4, 60, TimeUnit.SECONDS, new ArrayBlockingQueue&l...