Task scheduling method and device

A task scheduling and task technology, applied in the computer field to achieve the effect of improving memory access efficiency and performance

Active Publication Date: 2016-08-24
HUAWEI TECH CO LTD +1
View PDF6 Cites 35 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, there is a problem: after the introduction of "lock" in the parallel processing process of multi-core processors, although it is possible to prevent multiple threads from accessing a data block at the same time when executing tasks in parallel, during the parallel execution of tasks by multiple threads, There is still the problem that multiple threads compete for the lock of a data block at the same time, and the lock competition will bring additional performance overhead

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 scheduling method and device
  • Task scheduling method and device
  • Task scheduling method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0068] A task scheduling method provided by an embodiment of the present invention, such as figure 2 As shown, the task scheduling method includes:

[0069] S101. The task scheduling device adds each of the multiple tasks to the task queue of the data block corresponding to the task according to the correspondence between the multiple tasks to be executed and the M data blocks to be accessed by the multiple tasks.

[0070] Wherein, the M data blocks are in one-to-one correspondence with the M task queues.

[0071] Exemplary, such as image 3 As shown in , assuming that there are currently 3 data blocks to be accessed (DB 0 、DB 1 and DB 2 ). Among these three data blocks, DB 0 Corresponding to task queue 0, DB 1 Corresponding to task queue 1, DB 2 Corresponds to task queue 2.

[0072] Assume that in the current multiple tasks (task a, task b, task c, task d, task e, task f and task g), task a and DB 0 and DB2 There is a corresponding relationship, task b and DB 0 Th...

Embodiment 2

[0140] An embodiment of the present invention provides a task scheduling device, such as Figure 10 As shown, the task scheduling device includes: a task adding module 21 and a task executing module 22 .

[0141] The task adding module 21 is used to add each task in the multiple tasks to the data block corresponding to the task according to the corresponding relationship between the multiple tasks to be executed and the M data blocks to be accessed by the multiple tasks A task queue, wherein the M data blocks are in one-to-one correspondence with the M task queues.

[0142]The task execution module 22 is configured to use N threads to execute in parallel the tasks added by the above task adding module 21 to the N task queues in the above M task queues, wherein each thread in the N threads executes the N tasks Tasks in a task queue in the queue, different threads in the N threads execute tasks in different task queues, 2≤N≤M.

[0143] Further, such as Figure 11 As shown, th...

Embodiment 3

[0166] An embodiment of the present invention provides a task scheduling device, such as Figure 13 As shown, the task scheduling device includes:

[0167] One or more processors 31, memory 32, bus system 33, and one or more application programs, the one or more processors 31 and the memory 32 are connected through the bus system 33; the one or more One or more application programs are stored in the memory 32, the one or more application programs including instructions.

[0168] The processor 31 is used to execute the instructions, and is specifically used to replace the above-mentioned task adding module 21, task executing module 22, queue adding module 23, and queue deleting module 24, etc., to execute as figure 2 , Figure 6 , Figure 8 and Figure 9 The task scheduling method shown in any one of the accompanying drawings. That is, the processor 31 can be the integration of functional units or functional modules such as the above-mentioned task adding module 21, task ...

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 embodiment of the invention discloses a task scheduling method and device and relates to the technical field of computers. The situation that when multiple threads carry out tasks in parallel, the threads have access to one data block at the same time, so that data competition is triggered can be avoided, additional performance expenses caused by introduction of a lock can also be avoided, and the detection and debugging difficulty of concurrent errors is lowered. According to the specific scheme, according to the corresponding relation between multiple to-be-executed tasks and M data blocks to be accessed by the tasks, each of the tasks is added to a task queue of the data block corresponding to the task; N threads carry out the tasks in the N task queues in the M task queues in parallel, each of the N threads carries out the tasks in one of the N task queues, and different threads in the N threads carry out the tasks in different task queues, wherein N is larger than or equal to 2 and smaller than or equal to M. The method and device are used for the task scheduling process of a multi-core system.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a task scheduling method and device. Background technique [0002] With the development of processor technology, multi-core processors are used more and more widely. Most processors on the market adopt a multi-core and multi-thread architecture, and even many terminal configurations have 4-core or even 8-core processors. [0003] Streaming application is a common type of application. When using the above-mentioned multi-core processor to process the application data of the streaming application, in order to make full use of the parallel processing capability of the multi-core processor, the application data of the streaming application can be divided into multiple For the data block, the above-mentioned multiple data blocks are processed in parallel by the multi-core processor. Wherein, during the parallel processing of the multi-core processor, when at least two threa...

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/48
CPCG06F9/4881
Inventor 赵鹏刘雷曹玮
Owner HUAWEI TECH 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