JUC knowledge summary

JUC Summary

to sum up:

Generally speaking, and its sub-contracting, ie java.util.concurrent package, focused on a variety of basic tools like Java concurrency, specifically:

  1. Provide more advanced than the Synchronized various synchronization structure: CountDownLatch, CyclicBarrier, Semaphore, etc., can achieve a richer multi-threaded operations, such as using Semaphore resource controller, limit the number of threads simultaneously.
    JUC structures of various synchronization (Semaphore, CountDownLatch, CyclicBarrier)
  2. A variety of thread-safe container: ConcurrentHashMap, ordered ConcurrentSkipListMap or snapshot mechanism to achieve thread-safe dynamic array CopyOnWriteArrayList
    JUC variety of thread-safe container
  3. Various concurrent queue, various BlockedQueue achieve such ArrayBlockingQueue, SynchronousQueue, or the like for the overhead of the scene PriorityBlockingQueue
    variety of concurrent queue JUC Concurrent, CopyOnWrite, Blocking
  4. Executor powerful framework that can create different types of thread pool thread pool do not need to implement from scratch and task scheduler in most cases
    JUC of various thread pool

Supplementary knowledge:

Published 40 original articles · won praise 0 · Views 578

Guess you like

Origin blog.csdn.net/weixin_42610002/article/details/104731863