Java.util.concurrent package source code read (i) source package structure

Source: Internet
Author: User
Tags data structures

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/

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.