The reason:

  • 1. The gap between the drive of hardware and the development of the Internet is getting wider and wider.
  • 2. Multicore servers are evolving.
  • 3. The system concurrency of large Internet manufacturers is easily over one million, so the traditional middleware and database can no longer protect us from wind and rain, but become the bottleneck.

How to learn concurrent programming

In fact, concurrent programming can be summarized as three core issues: division of labor, synchronization, mutual exclusion.

  • Division of labor: How efficiently do you take tasks apart and assign them to threads
  • Synchronization: how do threads work together
  • Mutually exclusive: Only one thread is allowed to access a shared resource at a time

A large part of the Java SDK and package distribution is organized along these three dimensions, such as Fork/Join framework as a mode of division, CountDownLatch as a typical synchronization mode, and reentrantable locks as a means of mutual exclusion.

Once you’ve figured out the core issues of concurrent programming, go back to the Java SDK and start packing, and you’ll be well organized and not confused.

The difficulty?

First of all, concurrent programming is tedious to learn. Because this involves operating system, CPU, memory and so on many aspects of knowledge, therefore, we have to stick to do, learn to prepare.