Be prepared to take a moment to read the Java code in the Java.util.concurrent package, which I personally think can be roughly divided into five parts (if there is a mistake, I also want to correct it).
First part aomic data type
This section is placed in the Java.util.concurrent.atomic package, which implements the data type of the atomization operation, including Boolean, Integer, Long, and referrence four types, and the four types of array types.
Part Two lock
This part is placed in the Java.util.concurrent.lock package, which implements several types of locks in concurrent operations.
The concurrency implementation of some data structures in the Java set framework in the third part
This part of the implementation of the data structure is mainly list, queue and map.
Part Four multithreaded task execution
This section basically involves three concepts,
Callable the task to be carried out
Executor Perform Tasks
Future The return data for an asynchronous commit task
Part fifth threading Management class
This part is mainly on the implementation of the management of the thread set, there are Cyclicbarrier, Countdownlatch,exchanger and other classes
The above is a rough analysis of the structure of the package, followed by a partial reading of the Java code, and here to write some ideas and experience to share with you.
Author: cnblogs Wu Liu Qi
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/