1. Reduce cost and improve efficiency
Reduce the time of thread creation and destruction and the overhead of system resources;
At the same time, it improves the response speed of the system. When a new task arrives, it can be executed immediately by reusing the existing thread without waiting for the creation of a new thread.
2. Improve the manageability of threads
It is convenient to control the number of concurrent threads. Unlimited thread creation may lead to excessive memory consumption, resulting in oom, and will cause excessive CPU switching. There is a time cost for CPU switching threads: it is necessary to keep the scene of the current thread and restore the scene of the thread to be executed.
It can allocate, tune and monitor threads in a unified way, so as to improve the response speed, and provide more powerful functions, such as delaying and timing thread pool.
Read More:
- Multithreading: when doing unit test, use thread pool to find that the specified code is not running and skip directly
- Remember a virtual machine expansion swapoff failed: cannot allocate memory
- Remember the error of using unaddressable value of a novice goer
- Why must microservices have gateways?
- Remember once to solve the problem that Ubuntu 18.04 can’t enter GUI
- Remember a mybatis error org.apache.ibatis . session.defaults.DefaultSqlSession
- appear pygame.error : font not initialized problem, remember to check whether the program calls pygame.init ()
- The reason why HashMap multithreads send out life and death loops
- Why interview requires reading the source code
- [solved] why can’t open the lightning simulator using remote desktop, OpenGL version 1.1.0?
- angular.js Error:[$ injector:modulerr ]Why
- Typeerror: object of type ‘response’ has no len() why?
- Remember a feign error: feign.FeignException : status 404 reading XXXClient#XXMethod(Long)
- Why namenode can’t be started and its solution
- Why not manage controller in spring container
- RT-thread assertion failed at function:rt_application_init
- Why fan error appears in ThinkPad Lenovo IBM notebook
- Why does the result screen flash when visual studio runs the program?
- Why can’t Scala shell enter Q to exit
- Why can’t I open the R tidyverse package after installation