1:获取cpu核心数: Runtime.getRuntime().availableProcessors();
创建线程池: Executors.newFixedThreadPool(nThreads);//nThreads为线程数2:
1:获取cpu核心数: Runtime.getRuntime().availableProcessors();
创建线程池: Executors.newFixedThreadPool(nThreads);//nThreads为线程数2:
转载于:https://www.cnblogs.com/haoerlv/p/7234573.html