Java Program Performance Optimization learning note ⅲ Parallel program optimization

Source: Internet
Author: User
Tags cas

Fourth chapter Parallel Program Optimization
4.1 Parallel Programming patterns
4.2 JDK Multi-task execution framework
4.3 JDK concurrency data structure
4.4 Concurrency control method
4.5 Lock performance and optimization
4.6 Lock-free parallel computing

1. The non-blocking synchronization avoids the defect of lock-based synchronization, and the lock-free algorithm does not have the overhead of lock contention and the overhead of frequent scheduling between threads.
CAS algorithm: consists of 3 parameters CAs (v,e,n). V indicates the variable to be updated, E represents the expected value, and n represents the new value
Under the java.util.concurrent.atomic package of 2.JDK, there is a set of atomic operation classes implemented using the lock-free algorithm, such as Atomicinteger/atomicintegerarray/atomiclongarray,

Multithreading security operations for integers, integer arrays, long shaped arrays, and so on are packaged separately.

4.7 threads
1. A thread is a further division of a process, which can be understood as a further separation of threads. The
is a good implementation of the association in the Lua language. The
2.Java native language does not support covariance, and Kilim is a popular co-process framework. The
use of the coprocessor allows the system to support a higher degree of parallelism at a lower cost.

Related Article

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.