摘要: 一、基础铺垫 首先我们来个例子: public class AtomicMain { public static void main(String[] args) throws InterruptedException { ExecutorService service = Executors.ne 阅读全文
posted @ 2020-07-09 10:04 叉不到鱼的harpoon 阅读(285) 评论(0) 推荐(0) 编辑
摘要: Java为我们提供了三个同步工具类: CountDownLatch(闭锁) CyclicBarrier(栅栏) Semaphore(信号量) 这几个工具类其实说白了就是为了能够更好控制线程之间的通讯问题。 一、CountDownLatch 1.1CountDownLatch简介 CountDownL 阅读全文
posted @ 2020-07-09 09:39 叉不到鱼的harpoon 阅读(296) 评论(0) 推荐(0) 编辑