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.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
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