It is indeed a concurrent programming note from Ali P8! Overturned my previous "correct" cognition

For a Java programmer, whether he can master concurrent programming proficiently is one of the important criteria for judging whether he is good or not. Because concurrent programming is the most obscure knowledge point in the Java language, it involves basic capabilities in many aspects such as operating system, memory, CPU, programming language, etc., and it tests the internal skills of a programmer.

So how should you learn concurrent programming? There are many concurrency toolkits in the Java SDK. Is it necessary to memorize the advantages, disadvantages and usage scenarios of each tool by rote? Of course not. If you want to learn concurrent programming well, you need to "jump out" from a single knowledge and technology, look at the problem from a high-level perspective, and gradually build your own knowledge system.

Here, for those who do not have a thorough understanding of the principles of concurrent programming, and who have a vague understanding of concurrent programming, they should be a little embarrassed when the interviewer asks the volatile principle and AQS during the interview . Here, the editor is going to share with you a nanny-level concurrent programming core note that I spent a lot of money on. The following are the characteristics of this note, which may subvert your previous understanding of the "correctness" of concurrent programming.

  • * Subvert some cognitions that you think are "correct", and correct the mistakes of other similar books and notes

  • * 100+ hand-drawn drawings & flowcharts to help you form a correct "multi-threaded worldview"

  • * Taking knowledge points as the main line, interspersed with explanations of "application", "principle" and "multi-thread design pattern", to learn and understand concurrency in multiple dimensions

First look at a knowledge system map:

The notes are based on concurrency and parallelism as the main line, interspersed with explanations

Application - combined with reality

Principles - Clearly understood

Patterns - Correct Posture

Concurrent Programming Sharing Model

  • An overview of concurrent programming

  • process and thread

  • java thread

  • Monitor for shared models

  • shared model memory

  • Lock-free shared model

  • Immutable shared models

  • Tools for Sharing Models

Monitor for shared models

Principle of Monitor (lock)

Principle of false sharing

Patterns - Correct Posture

  • Protective smart stop in synchronous mode

  • Blking in synchronous mode

  • Shun of Synchronous Mode

  • sequence control

  • Producer consumer in asynchronous mode

  • Worker threads in asynchronous mode.

  • Two-stage termination mode of termination mode

  • thread safe singleton

  • Flyweight mode

Protective Pause in Synchronous Mode

Application - combined with reality

  • efficiency

  • limit

  • mutually exclusive

  • synchronous and asynchronous

  • cache

  • Partition

  • coordinating

  • timing

Cache update strategy

Principles - Clearly Known

  • Principle of Instruction Level Parallelism

  • CPU cache structure principle

  • volatile principle

  • fnal principle

  • Monitor principle

  • synchronized principle

  • Advanced synchronized principle

  • wait notify principle

  • join principle

  • park unpark principle

  • Principle of AQS

  • Principle of ReentrantLock

  • Read-write lock principle

  • Semaphore principle

  • CourentHashMap, principle

  • LnkedlockingQueue principle

  • Principle of ConcurenLinkedQueue

Principle of Instruction Level Parallelism

Principle of CPU cache structure

CPU cache coherency

Guess you like

Origin blog.csdn.net/SharingOfficer/article/details/131107083