1, Newcahchethreadpool:
Thread pool can be created as needed, if the thread is not available, when a new task comes, create a new thread to add to the line constructor. Resources are reclaimed for threads that are not used in the thread pool for more than 60s
2, Newsigletreadpool:
Create a single thread pool, that is, only one of the threads in this thread is working, the task is serial, and if the running thread ends abnormally, there will be a new thread pulling up, the thread pool will ensure that all tasks are executed in the order in which they are submitted.
3, Newfiexdtreadpool:
Create a fixed-size thread pool, create a thread pool each time a task is committed, and then reach the maximum number of threads, the maximum thread pool will remain the same, and if a thread ends up with an exception, a new thread will be created.
4, Newscheduledthreadpool:
Creates a thread pool of unlimited size that supports timing and the need to perform tasks periodically.
Four types of thread pools provided by executors