摘要:
public class StreamTest { List<Student> students = Arrays.asList( new Student("张三",12, Student.Status.VOCATION), new Student("李四",18, Student.Status.B 阅读全文
该文被密码保护。 阅读全文
摘要:
手写MiniBlockingQueue阻塞队列 BlockingQueue接口 package com.xiaozhou; public interface BlockingQueue<T> { void put(T element) throws InterruptedException; T t 阅读全文
摘要:
AQS独占模式(基于ReentrantLock公平锁) — 源码解析 一、 基本概念 AQS全称 AbstractQueuedSynchronizer, 是JUC包下的一个抽象类。可以说它是整个JUC并发的基础框架。非常重要。在ReentrantLock, ReentrantReadWriteLoc 阅读全文
摘要:
手写mini版ReetrantLock(AQS公平锁) package com.xiaozhou; import sun.misc.Unsafe; import java.lang.reflect.Field; import java.util.concurrent.locks.LockSuppor 阅读全文
摘要:
JUC 线程池 一、基本概念 提到线程池,我们首先会想到创建多线程的4中方式: 直接继承Thread,重写run方法 实现Runnable接口,传入Thread构造中 new FutureTask( Runnable实现/Callable实现) → new Thread(futureTask).st 阅读全文