• 周六. 10 月 12th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

Jdk8 concurrent programming practical source code research series (1) and contract overview

King Wang

1 月 3, 2022

Recruitment of first-line large factories , R & D of high concurrency system , Advanced advanced programmer … Concurrent programming is a must . And go deep into its principles 、 Source code to write high-quality code .
JDK8 The concurrent programming practice source code Exploration Series involves java.util.concurrent The principle of almost all classes or interfaces in a package 、 Use actual combat 、 Source code explanation .
In the middle may be interspersed with the bottom layer of computer principle 、CPU、 operating system 、JMM、 Byte code analysis and other knowledge points , Deeper 、 Master all aspects of concurrent programming .

JDK8 And contract overview

The following information is based on openjdk8 describe :

java.util.concurrent The direct bag contains 59 Class or interface .

java.util.concurrent.atomic It contains 18 Class or interface .

java.util.concurrent.locks It contains 11 Class or interface .

Atomic classes (atomic package )

explain , Atomic class or CAS Operation depends on Unsafe class , So this class also needs to understand .

A class

  • AtomicInteger
  • AtomicBoolean
  • AtomicIntegerArray
  • AtomicLong
  • AtomicReference

Two category

  • AtomicMarkableReference
  • AtomicStampedReference

Three types of

  • AtomicIntegerFieldUpdater
  • AtomicLongFieldUpdater
  • AtomicReferenceFieldUpdater

Four types of

  • Striped64
  • LongAdder
  • DoubleAdder
  • LongAccumulator
  • DoubleAccumulator

lock (locks package 、AQS)

A class

  • AbstractQueuedSynchronizer
  • Lock Interface
  • ReentrantLock
  • Condition
  • LockSupport

Two category

  • ReadWriteLock Interface
  • ReentrantReadWriteLock
  • StampedLock

Concurrent tool class (concurrent Direct package )

  • CountDownLatch
  • CyclicBarrier
  • Semaphore
  • Exchanger
  • Phaser

Concurrent collection classes (concurrent Direct package )

  • ConcurrentHashMap
  • ConcurrentLinkedQueue
  • ConcurrentSkipListMap
  • CopyOnWriteArrayList

Queue related classes (concurrent Direct package )

  • ArrayBlockingQueue
  • LinkedBlockingQueue
  • PriorityBlockingQueue
  • SynchronousQueue
  • DelayQueue
  • LinkedTransferQueue

Thread pool (concurrent Direct package )

  • Executor 、 ExecutorService 、ThreadFactory、RejectedExecutionHandler Interface
  • Executors
  • ThreadPoolExecutor
  • ScheduledThreadPoolExecutor
  • ThreadLocalRandom
  • TimeUnit

Fork/Join

  • ForkJoinPool
  • ForkJoinTask
  • ForkJoinWorkerThread

Callable&Future&CompletableFuture

  • Callable
  • FutureTask
  • CompletableFuture
  • ExecutorCompletionService

发表回复