thread pool problem

1. Get to know the thread pool for the first time:

  Create some threads in advance according to the amount of tasks, block and wait, and wake up an idle thread to execute the task once a task arrives. (understand by yourself)

  According to the environment of the system itself, the number of execution threads can be effectively limited, so that the running effect is optimal. Threads are mainly controlled by the number of threads to be executed, and the threads that exceed the number wait in line, wait for the task to be executed, and then take out the task from the front of the queue for execution. (Baidu)
2. Thread pool function:
  Reduce the number of threads created and destroyed, each worker thread can be used multiple times
  The number of threads executed can be adjusted according to system conditions to prevent excessive memory consumption
3.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324942911&siteId=291194637