Method and device for executing task and adjusting number of remaining threads in thread pool

A thread number and thread pool technology, applied in the computer field, can solve problems such as occupying a lot of system resources, too late to process, destroy, etc., to achieve the effects of reducing system resource consumption, ensuring response speed, and reducing system resources

Active Publication Date: 2013-08-28
NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF5 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] In the existing thread pool technical solutions, the number of reserved threads is generally fixed, and can be adjusted manually in a few cases, but the software that uses thread pool technology needs to be restarted, and the number of reserved threads cannot be automatically adjusted
Due to the unpredictable fluctuation of the number of tasks, when the task interface of the thread pool receives a large number of tasks within a certain period of time, and the reserved thread is too late to process these tasks within the specified time limit, the thread pool manager needs to perform more task queue operations. It is also necessary to create a large number of extended threads; when the number of tasks falls back and remains for a period of time, and the extended threads are idle, the thread pool manager needs to destroy the extended threads, and some reserved threads may also be idle
[0010] To sum up, the technical solution of retaining a fixed number of threads in the thread pool of the prior art will increase the consumption of system resources by non-task operations and reduce the response speed to tasks when the number of tasks is large; when the number of tasks is small, redundant Idle reserved threads will take up more system resources

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 executing task and adjusting number of remaining threads in thread pool
  • Method and device for executing task and adjusting number of remaining threads in thread pool
  • Method and device for executing task and adjusting number of remaining threads in thread pool

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0059] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many of the details listed in the specification are only for readers to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.

[0060] As used herein, terms such as "module" and "system" are intended to include computer-related entities such as, but not limited to, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a module may be, but is not limited to being limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and / or a computer. For example, both an applicatio...

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 invention discloses a method for executing a task and adjusting the number of remaining threads in a thread pool and a device for executing the task and adjusting the number of the remaining threads in the thread pool. The method comprises the steps that the frequency of non-task operation in a period is counted periodically; the number of the remaining threads in the thread pool in the next period is determined according to the frequency, counted in the period, of the non-task operation; the determined number of the remaining threads in the thread pool in the next period is compared with the number of the remaining threads in the current thread pool, the remaining threads in the current thread pool are adjusted according to the compared result, and the remaining threads with the number adjusted in the next period are obtained; the number of the remaining threads in the thread pool is adjusted periodically through the method and the task is executed, so that system resource consumption of the non-task operation in the working process of the thread pool is reduced, the speed of response to the task is guaranteed, and system resources occupied are further reduced.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a task execution technology based on adjusting the number of reserved threads in a thread pool. Background technique [0002] At present, software such as operating systems or application programs of servers, switches, mobile communication terminals and other equipment often need to process a huge number of task requests per unit time, but the processing time of a single task is relatively short. The traditional multi-threading solution adopts the strategy of "instant creation, instant destruction": once a task is received, a new thread is created immediately, and the thread executes the task; after the task is executed, the thread exits. Although compared with creating a process, the time for creating a thread has been greatly shortened, but if the task submitted to the thread has a short execution time and the number of executions is extremely frequent, the system resources c...

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/45G06F9/50
Inventor 郑扬飞朱春玲梁云杰吴卫荣刘玉龙吴瑜胡春波贾晓霞刘毅葛洁
Owner NO 15 INST OF CHINA ELECTRONICS TECH GRP
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