Unlock instant, AI-driven research and patent intelligence for your innovation.

Task processing method, device, equipment and medium of java thread pool

A technology of task processing and thread pool, which is applied in the field of data processing, can solve problems such as waste of resources and inability to allocate new tasks, and achieve the effect of ensuring throughput

Active Publication Date: 2022-05-20
WUHAN UNITED IMAGING HEALTHCARE CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In traditional technology, the commonly used rejection strategy is the caller-run strategy. In the case of using this rejection strategy, when the thread pool reaches the maximum number of threads and the buffer queue is full, the main thread executes the task, and then When a new task comes, even if other threads are already idle, but because the main thread is executing tasks and is in a busy state, new tasks cannot be assigned to the current thread pool
[0004] Therefore, the execution method of the traditional Java thread pool rejection strategy has the problem of waste of 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
  • Task processing method, device, equipment and medium of java thread pool
  • Task processing method, device, equipment and medium of java thread pool
  • Task processing method, device, equipment and medium of java thread pool

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] In order to make the purpose, technical solution and advantages of the present application clearer, the present 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 the present application, and are not intended to limit the present application.

[0037] Creating and destroying threads in Java consumes a lot of time and resources. Therefore, thread pool technology is used in multitasking to cache the created threads. When a new task arrives, the thread is called to execute the new task directly without further Newly created thread. Usually, when a new task is added to the thread pool, if there is an idle worker thread in the thread pool, the worker thread will run the task; if there is no idle worker thread, the task will be saved to the buffer queue and wait for The current task of the worker thread has finished r...

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 present application relates to a task processing method, device, computer equipment and storage medium of a Java thread pool. The method includes: when the target task is received, judging whether the thread pool is full; the target task is a task in a preset task set; if the thread pool is full, according to the target value of the number of buffer queues corresponding to the thread pool, The target number of threads corresponding to the thread pool and the minimum task time consumption corresponding to the task set determine the waiting time required to execute the target task; where the minimum task time consumption is the minimum value of the task time consumption of each task corresponding to the task set; When the waiting time is up, the control main thread adds the target task to the thread pool. This method can avoid the waste of resources caused by the main thread executing tasks being blocked for too long and the threads in the thread pool being in an idle state.

Description

technical field [0001] The present application relates to the technical field of data processing, in particular to a task processing method, device, computer equipment and storage medium of a Java thread pool. Background technique [0002] Creating and destroying threads in Java consumes a lot of time and resources. Therefore, in the case of multi-tasking, we will choose to use thread pool technology to cache the created threads and execute them directly when new tasks arrive without renewing them. Create threads. Usually, when a new task is added to the thread pool, if there is no idle worker thread in the thread pool and the buffer queue is full, it will be judged whether the number of threads in the thread pool has reached the maximum number of threads, if not, Then start a new thread to execute the task. If the maximum number of threads has been reached, these tasks will be processed through the corresponding rejection policy. [0003] In traditional technology, the co...

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 Patents(China)
IPC IPC(8): G06F9/48G06F9/445G06F9/50
CPCG06F9/4881G06F9/44521G06F9/505G06F9/5011
Inventor 朱文魁
Owner WUHAN UNITED IMAGING HEALTHCARE CO LTD