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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com