1. Overview
The Java thread pool works like a database connection pool, because each time a thread is re-created is a resource-intensive operation, so we can create a thread pool so that when something needs to be done with the thread, we can go directly to the thread pool and find the idle threads. This allows you to use it directly, instead of waiting for it to be used, and then you can put the thread back into the thread pool for other requests and use it to improve the performance of your application.
2. Core processes
2.1. Build a Threadpoolexecutor and specify the number of threads to be created by default
2.2. Use Threadpool.execute () to add a thread to execute the Java class that implements the Runable interface
2.3. Write the specific business code in the Run method of the Java class that implements the Runable interface
The Interview thread pool