Method and device for controlling thread quantity in thread pool

A technology for controlling the number of threads, applied in the computer field, can solve problems such as the fixed maximum number of concurrent threads, the large number of pending tasks, and the untimely execution of pending tasks, so as to achieve the effect of improving operating efficiency

Inactive Publication Date: 2017-09-29
BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD +1
View PDF5 Cites 29 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, since the number of pending tasks in the task queue is variable, the maximum number of concurrent threads is fixed, which may lead to too many pending tasks in the task queue, and the pending tasks cannot be executed in time

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for controlling thread quantity in thread pool
  • Method and device for controlling thread quantity in thread pool
  • Method and device for controlling thread quantity in thread pool

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0026] The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

[0027] It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0028] figure 1 It shows an exemplary system architecture 100 to which embodiments of the method for controlling the number of threads in the thread pool or the apparatus for controlling the number of threads in the thread pool of the present application can be applied.

[...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The application discloses a method and a device for controlling thread quantity in a thread pool. An embodiment of the method includes steps of acquiring quantity of tasks to be treated in a task queue of the thread pool; increasing the maximum concurrent thread number of the thread pool according to a predetermined rule since the quantity in responding to the to-be-treated task is more than the first predetermined quantity, and the CPU use rate of the system where the thread pool locates is less than the predetermined threshold value; establishing a thread according to the increased maximum concurrent thread number. By the method, the running efficiency of the thread pool is improved.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method and device for controlling the number of threads in a thread pool. Background technique [0002] In a multi-process / multi-threaded operating system, time-consuming operations are usually handled by a separate thread. On the one hand, it is to avoid blocking the main thread and not affect the normal interactive operation of the user. On the other hand, it is to improve CPU performance. Utilization, improve the speed of task execution. However, if there are multiple time-consuming tasks that need to be processed and multiple threads are created at the same time, the CPU usage of the system will be high, which will cause each thread to process very slowly. In addition, it may also cause power consumption of the device / system Therefore, it is necessary to create a thread pool (ThreadPool) to control these threads, that is, to control the number of created thread...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/38G06F9/30
CPCG06F9/3009G06F9/3851
Inventor 常先堂简川力赵立峰
Owner BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products