![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
爱吃杏仁
这个作者很懒,什么都没留下…
展开
-
多线程执行返回结果
多线程执行返回结果 多线程操作 //代码块为什么是这样 public void test() throws InterruptedException, ExecutionException { Executor executor = Executors.newFixedThreadPool(3); CompletionService<String> service = new ExecutorCompletionService<>(executor);原创 2021-09-03 11:30:03 · 70 阅读 · 0 评论 -
大集合分割成多个小集合的方法
大集合分割成多个小集合的方法 最近项目有个上传excel文件的需求,读出数据形成大集合,在操作中用到多线程插入,需要一个线程操作一部分集合数据。下面是集合分割算法 /** * 对list进行切分 * @param historyList * @return */ public static void spiltList(List<NumberCard> historyList) { int listSize = historyLis原创 2021-09-03 10:50:34 · 237 阅读 · 0 评论