Introduction to java thread pool

        The top-level interface of the java thread pool is Executor, which only defines one method execute. ExecutorService inherits the interface Executor interface and defines other related interfaces. There is an inherited abstract class AbstractExecutorService under ExecutorService and an interface ScheduledExecutorService that implements timing scheduling. There are two more classes inheriting abstract classes, namely ThreadPoolExecutor and ForkJoinPool, while ScheduledThreadPoolExecutor implements the interface to implement the ScheduledExecutorService interface and inherits the ThreadPoolExecutor class. The basic relationship is this, and the basic commonly used encapsulation methods are in the Executors class, as long as Executors. xxxx can apply the corresponding encapsulation method.

For details, please refer to the following class diagram:

The relationship between the classes under the concurrent package includes thread pool-related classes and thread-safety-related classes, and of course lock locks, as follows:

Guess you like

Origin blog.csdn.net/qq_38428623/article/details/86690487