Concurrent package structure introduction

The Concurrent package in java provides some basic tools for concurrent programming in java, which can enable us to write thread-safe code more efficiently and reduce the possibility of thread deadlock caused by improper use.

The Concurrent package mainly includes atomic basic type classes, implementation of various locks based on AQS, thread pool framework, thread-safe collection classes, thread concurrency control classes (CountDownLatch, CyclicBarrier), and future interface implementations.

structure

The Concurrent package contains the atomic package and the locks package, as well as the direct classes under Concurrent.

atomic package

Basic types of atomic operation classes are provided in atomic
Insert picture description here

locks package

This package mainly implements locks in java, including AQS, and various locks based on AQS
Insert picture description here

Concurrent class

Concurrent This package mainly includes the thread pool Executor framework, thread-safe collections (BlockingQueue, ConcurrentHashMap, etc.), thread concurrency control classes (CountDownLatch, CyclicBarrier), and future interface implementations to obtain thread execution results.

Insert picture description here

to sum up

The Concurrent package mainly includes atomic basic type classes, implementation of various locks based on AQS, thread pool framework, thread-safe collection classes, thread concurrency control classes (CountDownLatch, CyclicBarrier), and future interface implementation.
The implementation of some specific classes can be found in the blog in my concurrent column

Guess you like

Origin blog.csdn.net/lzx_2011/article/details/109903294