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:
- 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) - 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 - 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 - 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: