Method and device for dynamically adjusting priority

A dynamic adjustment and priority technology, applied in the field of operating systems, can solve problems such as high-priority tasks cannot be run in time, and achieve the effect of avoiding priority inversion

Pending Publication Date: 2022-05-17
CHINA AUTOMOTIVE INNOVATION CORP
View PDF9 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Because tasks with lower priority occupy shared resources for a long time, the process with the highest priority applying for the resource is always in a waiting state. At this time, other tasks have higher priority than those occupying resources but have higher priority than processes waiting for resources. Low will get the right to use the processor and end before the process with the highest priority in the waiting state. This phenomenon is called priority inversion. Priority inversion will cause high-priority tasks to not run in time. For real-time system, which can sometimes cause fatal problems

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
  • Method and device for dynamically adjusting priority
  • Method and device for dynamically adjusting priority
  • Method and device for dynamically adjusting priority

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0051] Such as figure 1 As shown, the embodiment of this specification provides a method for dynamically adjusting priority, and the method includes:

[0052] S100: When the first task sends a request to acquire the target resource, determine whether the first task sends the request to acquire the target resource for the first time;

[0053] In this embodiment, the real-time operating system schedules tasks according to the task priority, and the task scheduler that gives priority to high-priority tasks to execute always deactivates a task that has the highest priority among all tasks and is in the ready state. State task, let it execute.

[0054] S200: When the first task sends out a request for acquiring the target resource for the first time, acquire the task priority of the first task, the dynamic priority of the target resource, and the second task currently occupying the target resource;

[0055] In a specific implementation manner, in step S200, when the first task se...

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 priority dynamic adjustment method and device, and the method comprises the steps: judging whether a first task transmits a request for obtaining a target resource for the first time or not when the first task transmits the request for obtaining the target resource; if yes, obtaining the task priority of the first task, the dynamic priority of the target resource and a second task currently occupying the target resource; when the task priority of the first task is higher than the dynamic priority of the target resource, setting the dynamic priority of the target resource as the task priority of the first task; adding the first task to a task chain table of a target resource, and adding the target resource to a resource chain table of the first task; and adjusting the task priority of the second task occupying the target resource to the dynamic priority of the target resource. By temporarily improving the task priority of the task occupying the resource to the dynamic priority of the target resource, the task is ensured to have enough priority for preferential operation so as to release the target resource as soon as possible, and priority inversion is avoided.

Description

technical field [0001] The invention relates to the technical field of operating systems, in particular to a method and device for dynamically adjusting priority. Background technique [0002] Before each job is input into the computer, it must be assigned a priority according to certain requirements. For example, the priority of the program should be specified according to the important nature of the program, and then the computer determines the order of processing each program according to the priority of each operating program, and even allows the program with a higher priority to be interrupted in the process of processing. That is to say, if the priority of the process to be run is higher than that of the running process, the system can forcibly deprive the CPU of the running process and let the process with higher priority run first. [0003] The operating system may have a priority inversion problem when it is running. For example, there are three priority tasks A, B...

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/48G06F9/50
CPCG06F9/4881G06F9/5022
Inventor 秦民孙炳彤苏伟
Owner CHINA AUTOMOTIVE INNOVATION CORP
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