会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
龙宇在天
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
26
下一页
2020年9月30日
ConcurrentHashMap与Hashtable、Collections.synchronizedMap(map)比较
摘要: ConcurrentHashMap是对HashMap的高并发实现 压力测试方法: /* * boolean retrieve : 是否获取,true获取和插入,false只插入 */ public static void pressureTest(final Map<String, Integer>
阅读全文
posted @ 2020-09-30 11:43 龙宇在天
阅读(205)
评论(0)
推荐(0)
2020年9月28日
BlockingQueue集合
摘要: 1.ArrayBlockingQueue 有边界2.PriorityBlockingQueue 无边界3.LinkedBlockingQueue 边界可有可无4.SynchronousQueue 新增一个元素,等待删除一个元素才会继续删除,容量大小为05.DelayQueue 延迟处理6.Linke
阅读全文
posted @ 2020-09-28 09:00 龙宇在天
阅读(139)
评论(0)
推荐(0)
2020年8月31日
ArrayList和LinkedList使用时的建议
摘要: /* * ArrayList:随机遍历比顺序遍历的效率高,因为它实现了RandomAccess接口 * LinkedList:顺序遍历比随机遍历的效率高,因为它没有实现RandomAccess接口 */ java.util.List<String> list = new ArrayList<>();
阅读全文
posted @ 2020-08-31 14:22 龙宇在天
阅读(179)
评论(0)
推荐(0)
2020年8月26日
CompletableFuture详解1
摘要: 初识CompletableFuture package com.dwz.executors; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFut
阅读全文
posted @ 2020-08-26 16:20 龙宇在天
阅读(529)
评论(0)
推荐(0)
2020年8月14日
使用CompletionService解决耗时时间过长任务导致的阻塞问题以及解决ExecutorService.shutdownNow()导致正在执行中的任务被打断,但该任务不会被返回
摘要: 使用CompletionService解决耗时时间过长任务导致的阻塞问题 package com.dwz.executors; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callabl
阅读全文
posted @ 2020-08-14 17:03 龙宇在天
阅读(1116)
评论(0)
推荐(0)
ScheduledExecutorService和ScheduledThreadPoolExecutor
摘要: 定时任务的四种形式: 1.无返回值,入参Runnable private static void testScheduledFutureRunnable() { ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecuto
阅读全文
posted @ 2020-08-14 14:38 龙宇在天
阅读(753)
评论(0)
推荐(0)
2020年8月11日
future的缺陷和CompletionService对他的优化
摘要: future的缺陷 package com.dwz.executors; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable;
阅读全文
posted @ 2020-08-11 16:34 龙宇在天
阅读(508)
评论(0)
推荐(0)
2020年8月10日
Future方法详解
摘要: future.get()和Future.get(long timeout, TimeUnit unit) package com.dwz.executors; import java.util.concurrent.ExecutionException; import java.util.concu
阅读全文
posted @ 2020-08-10 17:33 龙宇在天
阅读(1433)
评论(0)
推荐(0)
ExecutorService的API详解
摘要: ExecutorService的终止方法 package com.dwz.executors; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.c
阅读全文
posted @ 2020-08-10 11:34 龙宇在天
阅读(560)
评论(0)
推荐(0)
2020年8月6日
scheduler的前奏Timer&Crontab和Quartz的比较
摘要: 定时任务 scheduler solution 1.Timer/TimerTask 2.SchedulerExecutorServic3.crontab 4.cron4j 5.quartz 6.Control-M(商业版的) Timer问题: 当TimerTask的执行时间超过Timer规定的任务间
阅读全文
posted @ 2020-08-06 10:08 龙宇在天
阅读(324)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
26
下一页
公告
//右侧添加目录 //增加页面点击显示24字社会主义核心价值观