Method and system for checking tasks endless loop

A technology for detecting tasks and infinite loops, applied in the direction of multi-programming devices, etc., can solve problems such as infinite loop leakage detection of low-priority tasks, and achieve the effect of avoiding infinite loop leakage detection.

Inactive Publication Date: 2008-04-09
SHANGHAI HUAWEI TECH CO LTD
View PDF0 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Specifically, if the low-priority task has an infinite loop and the high-priority task is running normally, at this time, when the low-priority task switches to the high-priority task, the clock interrupt will clear the running time of the low-priority task. Therefore, even if a low-priority task enters an infinite loop, it cannot be detected, resulting in the detection of an infinite loop of low-priority tasks.

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 system for checking tasks endless loop

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] In this embodiment, the global counter and the infinite loop detection task for clearing the global counter are used to determine whether the duration of the non-running infinite loop detection task is greater than a preset threshold.

[0030] FIG. 1 is a flow chart of a method for detecting an infinite loop of tasks in an embodiment of the present invention. As shown in Figure 1, the method includes the following steps:

[0031] Step 100: In the system based on the priority task scheduling strategy, preset a global counter C with an initial value of 0; preset an infinite loop detection task TL with the lowest priority of the system, and execute the infinite loop detection task TL every time The global counter C performs a clear operation.

[0032] In practical applications, TL may also perform a decrement operation on the global counter C.

[0033] Step 101: when the clock of the system is interrupted, add M to the global counter, and detect whether the value of the ...

Embodiment 2

[0045] Embodiments 2 and 3 use the system time when the lowest-priority dead-loop detection task is running and the system time when the clock is interrupted to detect whether the duration of the non-running dead-loop detection task is greater than a preset threshold. The system time can be system absolute time or system relative time.

[0046] Embodiment two:

[0047] In this embodiment, the absolute time of the system when the lowest-priority dead-loop detection task is running is used to detect whether the duration of the non-running dead-loop detection task is greater than a preset threshold.

[0048] Specific steps include:

[0049] Firstly, in the system based on the priority task scheduling strategy, an infinite loop detection task TL with the lowest priority of the system is preset, and the absolute time of the system when the task TL is executed is recorded every time it is executed.

[0050] When a clock interruption occurs in the system, the clock interruption rou...

Embodiment 3

[0055] Most systems will provide the running time after the system is powered on, that is, the system relative time. This embodiment takes the time corresponding to the counter that counts clock interruptions as an example of the system relative time, and describes the technical solution provided by the present invention in detail. Specifically, this embodiment uses the value of the counter when the lowest-priority dead-loop detection task is running and the value of the counter when the clock is interrupted to detect whether the duration of the non-running dead-loop detection task is greater than a preset threshold.

[0056] Specific steps include:

[0057] Firstly, in the system based on the priority task scheduling strategy, an infinite loop detection task TL with the lowest priority of the system is preset. Every time the task TL is executed, it records the counter value that counts the clock interrupts of the system when it is running.

[0058] When a clock interruption 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 discloses a method for detection task closed loop, which comprises: in a system of a priority level-based task dispatch strategy, a closed loop detection task with the least priority level shall be preset; when the system clock is interrupted, detect whether the duration of the closed loop detection task for non-operation is greater than the preset threshold value, so as to decide that the task closed loop occurs in the system. The invention also discloses a system detecting the task closed loop. The invention ensures that in the system of the priority level-based dispatch strategy, the situation of missed detection on the low priority level task closed loop won't happen, and the detection of the task closed loop doesn't rely on the task dispatch strategy of the system.

Description

technical field [0001] The invention relates to the technical field of software, in particular to a method and a system for detecting an infinite cycle of tasks. Background technique [0002] With the continuous expansion of the software application field and the continuous enhancement of functions, the processing capability of the central processing unit (CPU, Central Processing Unit) is getting stronger and stronger, the amount of software code is getting bigger and bigger, and the implementation is getting more and more complicated. At the same time, in order to improve the real-time performance and throughput of the system, software systems generally adopt multi-task design. [0003] The task scheduling of the current operating system is usually task scheduling based on priority. Common scheduling strategies are divided into: priority non-preemptive scheduling, priority preemptive scheduling based on time slice rotation, and priority preemptive scheduling based on non-ti...

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/46
Inventor 邵泽强
Owner SHANGHAI 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