随笔分类 - java
摘要:一 类图 二 构造方法 public SynchronousQueue() { this(false); } /** * Creates a {@code SynchronousQueue} with the specified fairness policy. * * @param fair if
阅读全文
摘要:一 类图 二 构造方法 // LinkedBlockingQueue.java // take锁 private final ReentrantLock takeLock = new ReentrantLock(); // put锁 private final ReentrantLock putLo
阅读全文
摘要:一 阻塞队列API | | Throws exception | Special value | Blocks | Times out | | | | | | | | Insert | add(e) | offer(e) | put(e) | offer(e, time, unit) | | Rem
阅读全文
摘要:一 Executors工具类创建ThreadPoolExecutor | | SingleThreadExecutor | newFixedThreadPool | newCachedThreadPool | newScheduledThreadPool | newSingleThreadSched
阅读全文
摘要:java对象头之MarkWord 直接引用openjdk的cpp源码注释 // The markOop describes the header of an object. // // Note that the mark is not a real oop but just a word. //
阅读全文
摘要:解决了什么问题 A thread-safe variant of ArrayList in which all mutative operations (add, set, and so on) 引用CopyOnWriteArrayList的doc就是解决了ArrayList并发场景下对容器的修改安
阅读全文
摘要:摘要 AQS是什么 使用方式 源码原理 AQS是什么 摘自java doc,简而言之就是该类基于阻塞队列为同步锁的实现提供了框架功能 Provides a framework for implementing blocking locks and related synchronizers (sem
阅读全文