Prepare to take some time to see java.util.concurrent the source code of this package, to improve their understanding of Java, efforts ~ ~ ~
See the blog @ Wu Qi! Look at the source, while learning through the blog of the predecessor!
Code structure classification under package:
1.java.util.concurrent.atomic, like its English meaning, is a thread-safe, atomic-manipulation-related package
Another Java package designed specifically for thread safety, contains multiple atomic manipulation classes. This package provides a set of atomic variable classes. The basic feature is that in a multithreaded environment, when there are multiple threads executing the methods contained by instances of these classes at the same time, there is exclusivity, that is, when a thread enters the method and executes the instruction, it is not interrupted by another thread, and the other thread is like a spin lock until the method executes. It is only a logical understanding that the JVM chooses a second thread from the waiting queue to enter. It is actually implemented with hardware-related instructions that do not block threads (or simply block at the hardware level). You can manipulate basic data, basic data in an array, and basic data in a class. The atomic variable class is equivalent to a generalized volatile variable that supports both atomic and conditional read-write operations. --Quote @chenzehe Blog
Additional @ end points about Java.util.concurrent.atomic's article.
2.java.util.concurrent.lock, it is a lock-related package 3. Concurrent containers, some collection-related and queue-related classes
such as: Concurrenthashmap, Concurrentlinkeddeque
4. Actuators and Thread pools
such as: Scheduledthreadpoolexecutor, callable. I've used this before.
5. The rest of the time is classified into others, and the experience is discussed again
such as: Countdownlatch, Phaser, Forkjoinpool
For the time being, the following piece of the source of the learning, record the learning process and some experience, and everyone to share progress!
Java source Code of Java.util.concurrent Learning Note 01