JDK8并发包概览
以下信息依据 openjdk8描述:
java.util.concurrent
直接包里面包含 59 个类或者接口。
java.util.concurrent.atomic
里面包含18个类或者接口。
java.util.concurrent.locks
里面包含11个类或者接口。
原子类(atomic包)
说明,原子类或者说CAS操作都依赖于Unsafe类,所以这个类也需要了解。
一类
- AtomicInteger
- AtomicBoolean
- AtomicIntegerArray
- AtomicLong
- AtomicReference
二类
- AtomicMarkableReference
- AtomicStampedReference
三类
- AtomicIntegerFieldUpdater
- AtomicLongFieldUpdater
- AtomicReferenceFieldUpdater
四类
- Striped64
- LongAdder
- DoubleAdder
- LongAccumulator
- DoubleAccumulator
锁(locks包、AQS)
一类
- AbstractQueuedSynchronizer
- Lock 接口
- ReentrantLock
- Condition
- LockSupport
二类
- ReadWriteLock 接口
- ReentrantReadWriteLock
- StampedLock
并发工具类(concurrent直接包)
- CountDownLatch
- CyclicBarrier
- Semaphore
- Exchanger
- Phaser
并发集合类(concurrent直接包)
- ConcurrentHashMap
- ConcurrentLinkedQueue
- ConcurrentSkipListMap
- CopyOnWriteArrayList
队列相关类(concurrent直接包)
- ArrayBlockingQueue
- LinkedBlockingQueue
- PriorityBlockingQueue
- SynchronousQueue
- DelayQueue
- LinkedTransferQueue
线程池(concurrent直接包)
- Executor 、 ExecutorService 、ThreadFactory、RejectedExecutionHandler接口
- Executors
- ThreadPoolExecutor
- ScheduledThreadPoolExecutor
- ThreadLocalRandom
- TimeUnit
Fork/Join
- ForkJoinPool
- ForkJoinTask
- ForkJoinWorkerThread
Callable&Future&CompletableFuture
- Callable
- FutureTask
- CompletableFuture
- ExecutorCompletionService