ExecutorService executor = Executors.newCachedThreadPool(); for(int i=0;i<threadNum;i++){ String[] tempOrderIds = copyOrderIds(i, orderThresholdNum,orderNum,orderIds); executor.execute(()->{ try { doSomething(tempOrdersIds); } catch (Exception ex) { ex.printStackTrace(); } }); }
使用多线程
猜你喜欢
转载自www.cnblogs.com/mengjianzhou/p/9149492.html
今日推荐
周排行