Java source Code of Java.util.concurrent Learning Note 01

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.