上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 50 下一页
摘要: 使用方法 public static void main(String[] args) throws InterruptedException, ExecutionException { ExecutorService executorService = Executors.newFixedThre 阅读全文
posted @ 2021-09-06 14:42 意犹未尽 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 说明 使用方式参考:https://www.cnblogs.com/LQBlog/p/8983019.html 初始化 main public static void main(String[] args) throws InterruptedException { //<1>初始化 CountDo 阅读全文
posted @ 2021-09-03 17:56 意犹未尽 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 说明 使用方式可以参考:https://www.cnblogs.com/LQBlog/p/8983019.html 初始化 main public static void main(String[] args) throws InterruptedException, BrokenBarrierEx 阅读全文
posted @ 2021-09-03 17:56 意犹未尽 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 介绍 使用demo可以参考《Semaphore信号量》 作用:限制并发资源的并发访问数量 获取许可 main public static void main(String[] args) throws InterruptedException { //<c1>只允许10个并发同时处理 Semapho 阅读全文
posted @ 2021-09-03 16:05 意犹未尽 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 说明 我们都知道ArrayList不是线程安全的,在读的时候同时并发在写,在写的时候同时在读,会出现索引越界问题,解决这个问题醉简单的方式在写和读的地方都加上锁。都加上锁的话并发读也会产生互斥 但是为了性能 读的频繁写的时候比较少。我们都会允许读读共享,读写互斥,写写互斥,ReentrantRead 阅读全文
posted @ 2021-09-02 15:51 意犹未尽 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 说明 最近读到java ReentrantReadWriteLock 用到了位运算符 所以先看位运算符 再去学习源码 二进制在线计算器 http://www.99cankao.com/digital-computation/binary-decimal-converter.php 补码,反码,原码 阅读全文
posted @ 2021-08-31 15:09 意犹未尽 阅读(1204) 评论(0) 推荐(0) 编辑
摘要: 非公平锁 并不会严格按照队列先后顺序获取锁,可能会出现插队 阅读之前先要阅读《JUC锁框架源码阅读-AbstractQueuedSynchronizer》 类图 获取锁 main public static void main(String[] args) { //<1>创建锁 无参构造函数默认是非 阅读全文
posted @ 2021-08-30 17:07 意犹未尽 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 前言 最近在读canal-adpter源码的时候,源码里通过AQS+zookeeper实现了分布式锁。尝试看了一下,看不懂通过搜索锁类继承的父类才发现是AQS所以过来阅读源码。 阅读方式:直接看对应方法 点击<>可以跟代码 什么是AQS AQS是JUC锁框架中最重要的类,通过它来实现独占锁和共享锁的 阅读全文
posted @ 2021-08-26 16:41 意犹未尽 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 先看以下测试用例 public static void main(String[] args) throws ScriptException, InterruptedException, ParseException, IOException { System.out.println( 10.2 * 阅读全文
posted @ 2021-08-25 11:00 意犹未尽 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 加载支付配置的config类 @Slf4j public class CenterPayConfig { private static Properties conf = null; private final static String propertiesFilePath = "/centerp 阅读全文
posted @ 2021-08-23 09:58 意犹未尽 阅读(504) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 50 下一页