00 Build Your Java and Knowledge Network From Points to Planes

00 Build Your Java and Knowledge Network from Points to Planes #

Hello, welcome to learn “Java Concurrency Programming Core 78 Lectures”, I am lecturer Xu Longxi. I graduated with a Master’s degree from the Technical University of Munich in Germany and currently work at Didi Chuxing, responsible for the development of the Xiaoju Safe Driving Platform.

Solid theoretical foundation, valuable concurrent practice experience #

img

During my work, due to business needs, most of the scenarios I develop and take charge of are high traffic and high concurrency, many of which are practical applications of Java concurrency knowledge. Learning like a wanderer, from a novice to a concurrency master, faced with many difficulties, since I can’t avoid it, I can only change my attitude towards it.

img

From the initial confusion caused by the out-of-memory (OOM) problem of the thread pool, to the later ability to analyze the JUC (java.util.concurrent) source code in depth, accurately locate, reproduce, and fix concurrent problems online, and now able to cope with business scenarios with millions of traffic, predict and discover hidden thread safety hazards in them, I have taken some detours and stepped on some pitfalls during this period, and also accumulated a lot of valuable concurrent experience.

img

In addition, in the process of solving each concurrency problem, in the system design and implementation process, I have studied in detail a large number of domestic and foreign classic concurrency books and materials, implemented and verified the involved code one by one, and applied it to the business. During this period, I gradually established a complete Java concurrency knowledge system.

Why is concurrent programming so important #

As I came into contact with and took charge of more and more complex systems, I gradually discovered that whether it is for excellent system design or for the growth and career development of programmers, concurrent programming is a “threshold” that must be overcome. Once you cross this “threshold”, you will suddenly realize that everything is so simple, and your career development will also reach new heights.

img

  • Concurrency has gradually become a basic skill

For systems with moderate traffic, with the continuous increase in data and user volume, the concurrency easily exceeds ten thousand. If concurrency programming is not used, performance will quickly become a bottleneck. With the continuous improvement of server CPU performance and core count in recent years, it has also brought a broad space for concurrency programming. It can be said that there is demand and resource guarantee, and it has both the right timing and favorable conditions.

  • Concurrency is almost a mandatory topic for Java interviews

As the Internet has entered the second half, good companies have increasingly high requirements for programmers. Concurrency is almost an unavoidable keyword in the position descriptions of major Internet companies. Let’s take a few examples from job descriptions on Lagou.com.

img

img

img

img

img

img

You will find that concurrency programming has almost become a skill that must be mastered in the job requirements for Java senior engineers, and there are numerous concurrency programming-related questions in interview experiences. The knowledge points covered in each class in this column are also frequently asked in the interviews for Java senior engineers at major companies.

How to learn concurrent programming well #

Here, I invite you to take a small test to see if you can answer all the questions in the table of contents. I believe that after seeing the questions, most of you will feel familiar, but when it comes to organizing the answers, you may feel unsure. Then, let me show you how to learn Java concurrent programming well and overcome these difficulties.

img

  • Java programming is the basis and principle of many frameworks Whether it’s the application of thread pools in Spring and Tomcat, the optimistic lock concept in databases, or the application of blocking queues in Log4j2, they all reflect the idea of concurrent programming. Concurrent programming is widely applied, and major frameworks are closely related to concurrent programming.

Concurrent programming is like a foundation. Once mastered, it gives us a solid understanding of many other areas.

However, learning concurrent programming is not an easy task. Do you have the following feelings?

  • There is too much and too diverse knowledge about concurrency.

img

There are countless common concurrent utility classes, such as thread pools, various locks, the synchronized keyword, ConcurrentHashMap, CopyOnWriteArrayList, ArrayBlockingQueue, ThreadLocal, atomic classes, CountDownLatch, Semaphore, and more. The principles behind them include CAS, AQS, Java memory model, and so on.

img

From the long list of names just mentioned, you can see that there are many concurrent utility classes, and their functionalities are not exactly the same. It’s not easy to fully master all of them. Indeed, the knowledge points involved in concurrency are too fragmented. Almost everyone has studied some aspects of concurrency, but always feels that there is so much more to learn. It feels scattered, and we don’t know where it leads. As a result, after completing the learning, we can only remember very little of what we have learned. Moreover, if we want to understand the underlying principles of concurrency, it is not just about the Java language. It also involves JVM, JMM, operating systems, memory, CPU instructions, and so on, which can be very confusing.

  • It is not easy to find clear and understandable learning materials.

During my learning process, I always felt that there were very few resources that explained Java concurrent programming in a very clear way. For example, when studying a utility class, I wanted to understand its background, use cases, usage, precautions, and finally its principles, as well as its connections with other utility classes. All these aspects are what we need to master.

However, existing online materials often have uneven levels, making it difficult to distinguish between true and false, and they frequently contain errors. If we accept erroneous viewpoints as true, it will lead to more harm than good.

img

I hope this course can share the complex and difficult-to-understand concepts of Java concurrent programming with everyone in a simple and understandable way, using rich illustrations and examples. Not only will we learn how to use these concepts, but also understand the underlying principles.

By applying the concept of “global thinking + breakthrough point”, we can establish a knowledge system for concurrency, and at the same time, gain a deep understanding of various common utility classes. In the future, our knowledge can be connected from point to line, and from line to surface, becoming a holistic understanding.

By taking this course, you will gain the following benefits: #
  • You can establish a complete Java concurrent knowledge network.

Through this course, you can learn Java concurrent programming knowledge in a systematic way, instead of acquiring fragmented knowledge. Once you establish the knowledge framework, every utility class will no longer be something unapproachable, but rather a “piece of the puzzle” in our understanding of concurrency. I believe your understanding of concurrency will deepen.

img

After establishing a complete knowledge network, even if you encounter newly released concurrent utility classes in the future, you can quickly identify their position and master them based on existing knowledge.

  • You can master common concurrency utility classes.

This course covers most of the commonly used concurrency utility classes in practical production, including thread pools, synchronized, locks, pessimistic locks and optimistic locks, reentrant locks, fair locks and unfair locks, read-write locks, ConcurrentHashMap, CopyOnWriteArrayList, ThreadLocal, 6 types of atomic classes, CAS principle, thread collaboration with CountDownLatch, CyclicBarrier, Semaphore, AQS framework, Java memory model, happens-before principle, volatile keyword, correct methods for thread creation and termination, 6 thread states, and how to solve deadlock issues. From usage to principles, and even interview questions, you will have a thorough understanding.

  • It is a valuable tool for obtaining job offers during interviews.

Each section of this course starts with frequently asked interview questions. Firstly, I provide reference answers to these questions, and then extend to the associated knowledge behind them. This not only helps you answer interview questions well, but also enables you to further enhance your understanding based on the interview questions, leaving a good impression on the interviewer.

I will also share interview experiences and techniques with you, such as how to guide interviewers to our way of thinking. Ultimately, this will help you get your desired job offer and move on to a higher-level position.

It can be said that mastering concurrent programming is a necessary path to becoming a senior and experienced Java engineer. Almost all programs, to some extent, require concurrency and multithreading. If you only work on CRUD projects and want to further improve your technical skills, or if you are constantly translating business logic into code and are looking to change jobs or get a salary increase but keep hitting a wall during interviews, learning concurrent programming will help you break through these bottlenecks and advance to the next level.