线程池实现

2022-12-12  本文已影响0人  engineer_tang
ThreadPoolExecutor pool= null;

        pool = new ThreadPoolExecutor(
                80,
                120,
                60,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(1000),
                new ThreadFactoryBuilder().setNameFormat("test-%d").build(),
                new ThreadPoolExecutor.CallerRunsPolicy());
         .allowCoreThreadTimeOut(true);
上一篇下一篇

猜你喜欢

热点阅读