线程池执行任务流程
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 20,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(10));//自定义线程for (int i = 1; i <= 100; i++) {threadPoolExecutor.execute(new MyTask(i));}

线程池处理流程

线程池执行任务流程

