@@ -0,0 +1,1353 @@
+package thread.threadpoolexecutor;%0A%0Aimport java.util.concurrent.SynchronousQueue;%0Aimport java.util.concurrent.ThreadPoolExecutor;%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class DivTask implements Runnable %7B%0A    int a, b;%0A%0A    public DivTask(int a, int b) %7B%0A        this.a = a;%0A        this.b = b;%0A    %7D%0A%0A    @Override%0A    public void run() %7B%0A        double c = a / b;%0A        System.out.println(%22divid result: %22 + c);%0A    %7D%0A%0A    /**%0A     * Exception in thread %22pool-1-thread-1%22 java.lang.ArithmeticException: / by zero%0A     * at thread.threadpoolexecutor.DivTask.run(DivTask.java:17)%0A     * at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)%0A     * at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)%0A     * at java.base/java.lang.Thread.run(Thread.java:834)%0A     * divid result: 25.0%0A     * divid result: 100.0%0A     * divid result: 33.0%0A     * divid result: 50.0%0A     *%0A     * @param args%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        ThreadPoolExecutor pools = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 0l, TimeUnit.SECONDS, new SynchronousQueue%3C%3E());%0A%0A        for (int i = 0; i %3C 5; i++) %7B%0A//            %E5%90%83%E6%8E%89%E5%BC%82%E5%B8%B8%EF%BC%8Csubmit%EF%BC%8C%E6%B2%A1%E6%9C%89%E6%8A%9B%E5%87%BA%E4%B8%9A%E5%8A%A1%E5%BC%82%E5%B8%B8%0A//            pools.submit(new DivTask(100, i));%0A            pools.execute(new DivTask(100, i));%0A        %7D%0A%0A%0A    %7D%0A%0A%0A%7D%0A

add ThreadPoolExecutor