Task allocation method and device, electronic equipment, server and storage medium

An allocation method and task allocation technology, applied in the computer field, can solve problems such as thread pool starvation

Pending Publication Date: 2020-09-04
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The present disclosure provides a task allocation method, device, electronic equipment, server and storage medium to at least solve the problem of thread pool starvation in the related art

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 allocation method and device, electronic equipment, server and storage medium
  • Task allocation method and device, electronic equipment, server and storage medium
  • Task allocation method and device, electronic equipment, server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0091] As an optional implementation, the device also includes:

[0092] The second assignment module is configured to, if there is a first thread pool corresponding to the task identifier of the task to be assigned, then in the mapping relationship between the task identifier, the number of tasks and the thread pool, the task identifier of the task to be assigned corresponds to Add 1 to the number of tasks, and assign the to-be-allocated tasks to the first thread pool.

[0093] As an optional implementation, the device also includes:

[0094] The modification module is configured to subtract 1 from the number of tasks corresponding to the task identifier of the task to be assigned in the mapping relationship between the task identifier, the number of tasks and the thread pool after the execution of the task to be assigned is completed.

[0095] As an optional implementation, the device also includes:

[0096] The deletion module is configured to delete the task identifier o...

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 relates to a task allocation method and device, electronic equipment, a server and a storage medium. The method comprises the steps of obtaining a task identifier of a to-be-allocated task; querying whether a first thread pool corresponding to the task identifier of the to-be-allocated task exists or not in a mapping relationship among the task identifier, the task number and the thread pool; if the first thread pool corresponding to the task identifier of the to-be-allocated task does not exist, performing task allocation, if yes, determining a second thread pool with the minimum number of tasks to be executed in preset thread pools, adding a mapping relationship between the task identifier of the task to be allocated and the second thread pool in a mapping relationship among the task identifier, the number of tasks and the thread pool, and setting the number of tasks corresponding to the task identifier of the task to be allocated to be 1; and allocating the to-be-allocated task to the second thread pool. According to the invention, the thread pool starvation phenomenon can be prevented.

Description

technical field [0001] The present disclosure relates to the field of computer technology, and in particular to a task allocation method, device, electronic equipment, server and storage medium. Background technique [0002] During task scheduling, tasks with the same task ID need to be assigned to the same thread pool to ensure that tasks with the same task ID can be executed serially in the order in which the tasks are submitted. [0003] At present, when a task is allocated to a thread pool, first, the task ID of the task is modulo-calculated according to the number of the thread pool to obtain the remainder. Then, the task is assigned to the thread pool identified as the remainder by the thread pool. In this way, it can be guaranteed that tasks with the same task ID can be assigned to the same thread pool. [0004] However, when the number of first tasks with the same first task flag is large, it will cause severe task queuing in the thread pool corresponding to the fi...

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
IPC IPC(8): G06F9/48
CPCG06F9/4843
Inventor王天舟曹福祥王至前
OwnerBEIJING DAJIA INTERNET INFORMATION TECH CO LTD