并发相关
IFollowRivers
now is everything!
展开
-
SimpleDateFormat线程不安全问题
转自:http://www.cnblogs.com/peida/archive/2013/05/31/3070790.html 想必大家对SimpleDateFormat并不陌生。SimpleDateFormat 是 Java 中一个非常常用的类,该类用来对日期字符串进行解析和格式化输出,但如果使用不小心会导致非常微妙和难以调试的问题,因为 DateFormat 和 SimpleDateFor...转载 2019-04-21 19:07:59 · 189 阅读 · 0 评论 -
CountDownLatch和ExecutorService结合使用案例
4个人一起打麻将,人到齐了再开始,用CountDownLatch来控制 public class TestCountDownLatch2 { private static AtomicInteger id = new AtomicInteger(); private static ExecutorService executorService = new ThreadPoolE...原创 2019-04-23 20:21:40 · 1771 阅读 · 0 评论