Thread pool capable of dynamically adjusting size

The invention provides a thread pool capable of dynamically adjusting size and belongs to the field of computers. The thread pool is applicable to a situation that a large amount of threads are needed to complete a task and the time for completing the task is short, applications harsh in performance requirement so as to reduce time consumption for creating and destroying threads, and a large amount of sudden requests so as to prevent a server from creating a large amount of thread applications. The thread pool comprises a thread managing module for managing threads and distributing tasks, a task managing module for managing and scheduling the tasks, a task cache area for caching tasks issued by a user and a configuration file analyzing module for analyzing the configuration files used by the thread managing module and the task managing module. By the thread pool, thread creating and destroying efficiency is increased, the problem that the tasks cannot be executed due to the fact that thread creating fails is solved, and efficient and stable program operation is guaranteed.