Thread scheduling method, thread scheduling device and multi-core processor system

A scheduling device and processing system technology, which is applied in the computer field, can solve the problems that business threads and voice threads cannot be executed in time, the number of threads is unbalanced, and time-consuming, etc., so as to shorten the thread switching time, avoid switching between cores, and improve execution efficiency effect

Inactive Publication Date: 2013-10-23
GUIYANG LONGMASTER INFORMATION & TECHNOLOGY CO LTD
View PDF4 Cites 26 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Embodiments of the present invention provide a thread scheduling method, a thread scheduling device, and a multi-core processor system, which solve the problems caused by the thread switching between different computing cores taking too long or the number of execution threads on different computing cores being unbalanced The problem that the voice thread 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
  • Thread scheduling method, thread scheduling device and multi-core processor system
  • Thread scheduling method, thread scheduling device and multi-core processor system
  • Thread scheduling method, thread scheduling device and multi-core processor system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0028] Embodiment 1 of the present invention provides a thread scheduling method, taking the thread scheduler 110 as an example, as figure 2 As shown, the method includes the following steps:

[0029] Step 201, receiving a thread request;

[0030] Step 202, assigning the thread to a designated processing core for execution according to a preset assignment strategy;

[0031] Wherein, there are many ways to implement the assignment of the thread to the specified processing core for execution, for example: creating a thread on the specified processing core, or allocating a thread in the thread pool on the specified processing core.

[0032] Step 203, bind the thread with the specified processing core.

[0033] Among them, binding the thread to a specified processing core can avoid frequent switching of the thread among multiple processing cores, which can be realized by setting the CPU affinity (affinity).

[0034] In the Linux kernel, all threads have a related data structur...

Embodiment 2

[0041] Embodiment 2 provides a thread scheduling method, taking the thread scheduler 110 as an example, as image 3 As shown, the method includes the following steps:

[0042] Step 301, creating a thread pool for each processing core;

[0043] Among them, in order to reduce the overhead caused by thread creation and destruction, a thread pool is created for each processing core in advance. Since the multi-core processing system in this embodiment needs to handle a large number of frequent chat room entry, chat room exit, and voice conversation operations, the thread pool pre-establishes a limited number of fixed threads to serve a large number of business operations, reducing the creation and destruction of threads The required time, thereby improving the thread execution efficiency. Thread pool creation belongs to the prior art, for example: a thread pool created with C language under the Linux system, the thread pool maintains a task list, and each CThread_worker structure...

Embodiment 3

[0058] Embodiment 3 of the present invention provides a thread scheduling device, such as Figure 4 As shown, the device includes:

[0059] A receiving module 410, configured to receive a thread request;

[0060] The thread allocation module 420 is configured to allocate threads to specified processing cores for execution according to a preset allocation strategy;

[0061] The thread binding module 430 is configured to bind the thread to the processing core specified by the thread allocation module 420, so as to limit that the thread can only be executed on the specified processing core.

[0062] Wherein, the thread allocation module 420 includes:

[0063] Judging unit 421, configured to judge the type of thread request;

[0064] Statistical unit 422, used to count the load situation of the processing core;

[0065] The allocating unit 423 is configured to allocate the thread to the corresponding type of processing core with the lightest load for execution according to the...

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 provides a thread scheduling method, a thread scheduling device and a multi-core processor system. The thread scheduling method comprises the following steps: by receiving a thread request, according to a preset allocation strategy, allocating a thread to an appointed processing core for execution; setting parameter values of a thread affinity function; binding the thread with the appointed processing core so as to confine the thread only to the appointed processing core for execution. Through the thread scheduling method, the thread scheduling device and the multi-core processor system, inter-core switching between multiple threads is avoided, the thread switching expense is reduced, the thread switching time is shortened, and the multi-thread executing efficiency is enhanced.

Description

technical field [0001] The invention relates to the field of computers, in particular to a thread scheduling method, a thread scheduling device and a multi-core processor system. Background technique [0002] Currently, multi-core and multi-thread technology is widely used in network servers, such as large chat rooms, search engines and other software service platforms that require powerful parallel processing capabilities. [0003] Multi-core multi-threading technology refers to that in a multi-core processor system, multiple threads are executed simultaneously in a single program to complete different tasks. In a multi-core processor system, threads on the same computing core or different computing cores can switch between each other. Since threads have their own stacks, when switching between threads, it is necessary to save information such as program counters, context pointers, execution status, and register groups. The time overhead of switching between threads is rel...

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
Inventor 李晓鹏周平
Owner GUIYANG LONGMASTER INFORMATION & TECHNOLOGY 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