New! View global litigation for patent families

CN102495793A - Method for detecting endless loop task - Google Patents

Method for detecting endless loop task Download PDF

Info

Publication number
CN102495793A
CN102495793A CN 201110356415 CN201110356415A CN102495793A CN 102495793 A CN102495793 A CN 102495793A CN 201110356415 CN201110356415 CN 201110356415 CN 201110356415 A CN201110356415 A CN 201110356415A CN 102495793 A CN102495793 A CN 102495793A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
task
endless
loop
detecting
method
Prior art date
Application number
CN 201110356415
Other languages
Chinese (zh)
Other versions
CN102495793B (en )
Inventor
何三波
Original Assignee
迈普通信技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Abstract

The invention provides a method for detecting an endless loop task. The method comprises the following steps: an endless loop monitoring task with highest priority and an endless loop detecting task with the lowest priority are generated and enabled to operate periodically; everytime when the endless loop detecting task operates, the present time is recorded; everytime when the endless loop monitoring task operates, whether an endless loop task exists in an operating system is judged according to the operating condition of the endless loop detecting task; and the endless loop task existing in the system is located, and the located endless loop task is processed. The method provided by the invention can detect the endless loop task in the system under the premise of lower CPU resource consumption, and is simple to implement.

Description

一种检测死循环任务的方法技术领域[0001] 本发明涉及计算机操作系统技术领域,特别涉及一种检测死循环任务的方法。 TECHNICAL FIELD The task of detecting dead cycle [0001] The present invention relates to a computer operating system technology, and particularly relates to a method for detecting dead cycle task. 背景技术[0002] 在计算机操作系统中,有关死循环的检测及其处理是非常重要的技术。 [0002] In the computer operating system, related to an infinite loop detection and treatment are very important technology. [0003] 申请号为01112526. 8的发明专利申请中公开了一种实时多任务下死循环的处理方法,其描述了一种在实时多任务操作系统中,任务异常运行出现类死循环或者死循环的一种监控和处理方法。 [0003] Patent Application No. 01112526.8 disclosed invention is a method for processing the real-time multitasking infinite loop, which describes a real-time multitasking operating system, the task class abnormal operation occurs infinite loop or dead a method of monitoring and treatment cycles. 该专利的基本思想是使用时钟中断服务程序(ISR)和任务切换钩子函数来监控任务的运行时间,若任务的运行时间大于某个阀值,则认为该任务出现了死循环,此方法将大量消耗CPU资源。 The basic idea of ​​this patent is the use of the clock interrupt service routine (ISR) and a task switch hook function to monitor the run time of the task, if the task run time is greater than a certain threshold, it is considered that the task appeared endless loop, this method will be a large number of consume CPU resources. 与此类似的使用系统时钟中断和任务切换挂钩函数来检测死循环的方法都存在相同的缺点。 And such methods like the use of system clock interrupts and task switch hook function detects an endless loop of the same disadvantages are present. 发明内容[0004] 本发明提供了一种在多任务操作系统中检测死循环任务的方法,以克服现有技术检测死循环或类死循环任务时对操作系统CPU资源消耗过多的问题,本发明方法消耗CPU 资源少,并且实现简单。 The problem of excessive consumption SUMMARY OF THE INVENTION [0004] The present invention provides a method for detecting dead cycle task in a multitasking operating system, to overcome the prior art detect dead or almost dead cycle cyclic task operating system CPU resources, this The method of the invention consumes less CPU resources, and the implementation is simple. [0005](待权利要求的内容确定后,将拷贝至此)[0006] 由上述技术方案可见,本发明首先通过周期性运行的死循环监控任务和死循环检测任务确定操作系统中是否存在死循环任务;当存在死循环任务时,通过划分基于优先级的任务列表,设置任务列表的优先级控制块,并注册任务切换钩子函数对被调度任务的控制块及其优先级控制块中的相应字段进行设置,从而实现对死循环任务进行定位。 [0005] (the content of the claims to be determined, to this copy) [0006] can be seen from the above technical solutions, the present invention first determines whether there is an endless loop by periodically operating system running endless loop infinite loop detection and monitoring tasks task task; task when there is an infinite loop, by prioritizing the control block based on the priority of the task list, the task list is provided, and the task switch hook function register control block and its corresponding priority field in the control block of the task to be scheduled set up, in order to achieve an infinite loop positioning tasks. [0007] 为避免消耗过多CPU资源,本发明没有使用系统时钟中断服务程序检测死循环, 而是在仅通过耗费CPU资源极低的周期性运行的死循环监控任务和死循环检测任务检测到操作系统中存在死循环后,才向操作系统注册任务切换钩子函数对死循环任务进行定位,并且,任务切换钩子函数中的操作非常简单,对CPU资源的消耗极低,因此,本发明提出的技术方案具有消耗CPU资源少、且实现简单的有益效果。 [0007] To avoid excessive consumption of CPU resources, the present invention does not use a system clock interrupt service routine detects an endless loop, but at low cost only by detecting a CPU resource periodically operating cycle of death monitoring tasks and tasks to the endless loop detected after the operating system, there is a dead cycle, before switching to the operating system the task register dead hook function loop positioning task, and the task switching function hook operation is very simple, CPU resources consumption is very low, therefore, the present invention provides technical solutions have consumed less CPU resources, and the simple benefits. 附图说明[0008] 图1为本发明一较佳检测死循环任务的方法的流程示意图;[0009] 图2为本发明死循环监控任务的运行流程示意图;[0010] 图3为本发明死循环检测任务的运行流程示意图;[0011] 图4为本发明基于优先级划分任务列表的示意图。 BRIEF DESCRIPTION [0008] FIG 1 a preferred method for detecting dead cycle task schematic flow diagram of the present invention; [0009] FIG 2 a schematic flow monitoring task running endless loop of the present invention; [0010] present invention die of FIG. 3 run task detected a schematic flow loops; [0011] FIG. 4 is a schematic division of the task list based on the priority of the present invention. 具体实施方式[0012] 为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举实施例,对本发明作进一步详细说明。 DETAILED DESCRIPTION [0012] To make the objectives, technical solutions and advantages of the present invention will become more apparent, with reference to the accompanying drawings and the following embodiments, the present invention is described in further detail. [0013] 本发明利用在非时间片轮转的优先级抢占式操作系统中,只要高优先级任务不阻塞或者不主动出让CPU,那么低优先级任务或者与该高优先级任务具有相同优先级的其它任务就不能得到调度的原理,提出一种检测死循环任务的方法。 [0013] The present invention utilizes priority preemptive operating system, the non-round-robin, a long high priority task is not blocked or is not actively transfer the CPU, then the low priority task or have the same priority to the high priority task other task scheduling principle can not be obtained, a method for detecting an infinite loop task. 该方法首先生成具有最高优先级的死循环监控任务和具有最低优先级的死循环检测任务,然后令死循环监控任务和死循环检测任务周期性运行,死循环检测任务每次运行时记录当前时刻,死循环监控任务每次运行时,根据死循环检测任务的运行情况判断操作系统中是否存在死循环任务,在判定系统中存在死循环任务时,对死循环任务进行定位,并对定位到的死循环任务进行处理。 The method first generation with the highest priority task of monitoring the cycle of death and has the lowest priority infinite loop detection task, and then make an infinite loop monitoring tasks and periodically run an infinite loop detection tasks, record the current time infinite loop detection tasks each run , infinite loop monitoring tasks each run, according to the operation of the endless loop detection task determines whether there is an endless loop-tasking operating system, there is a dead cycle when the task judging system, the task of positioning an infinite loop, and the target infinite loop task for processing.

[0014] 本发明适用于所有基于优先级对任务进行调度的操作系统,特别适用于vxWorks 实时多任务操作系统。 [0014] The present invention is applicable to all operating system scheduling tasks based on priority, especially for real-time multitasking operating system vxWorks.

[0015] 下面通过一个较佳实施例对本发明进行详细说明。 [0015] The present invention will be described in detail by a preferred embodiment.

[0016] 图1为本发明一较佳检测死循环任务的方法的流程示意图。 [0016] FIG 1 a preferred method for detecting dead cycle task is a schematic flow diagram of the present invention. 参见图1,该方法包括: Referring to Figure 1, the method comprising:

[0017] 步骤101 :生成具有最高优先级的死循环监控任务和具有最低优先级的死循环检测任务,死循环监控任务和死循环检测任务周期性运行。 [0017] Step 101: generation having the highest priority and the infinite loop monitoring tasks with the lowest priority infinite loop detection task, and death cycle monitoring task running endless loop periodic inspection tasks.

[0018] 假设操作系统中任务的优先级为0〜100,优先级0为最低优先级,优先级100为最高优先级,则可以将死循环监控任务的优先级设置为100,将死循环检测任务的优先级设置为0。 [0018] Suppose the operating system the task priority of 0 to 100, priority 0 is the lowest priority, 100 is the priority of the highest priority, the endless loop may be monitored to set the priority of the task 100, the infinite loop detection priority task is 0.

[0019] 为保证死循环监控任务和死循环检测任务不占用大量的CPU,本发明中,死循环监控任务和死循环检测任务都周期性地运行,即:以固定的周期,每睡眠一段时间运行一次。 [0019] To ensure the monitoring tasks and the endless loop endless loop detection task do not take up a lot CPU, the present invention, an infinite loop endless loop monitoring tasks and tasks are run periodically detected, namely: a fixed period, each sleep period run once. 其中,死循环监控任务每睡眠较长周期运行一次,如图2所示;死循环检测任务每睡眠较短周期运行一次,如图3所示。 Wherein the dead loop monitoring tasks run once every sleep longer period, 2; infinite loop detection task every sleep cycle shorter run time, as shown in FIG. 这里,可以根据实际情况设置睡眠周期。 Here, you can set the sleep cycle according to the actual situation.

[0020] 步骤102 :死循环监控任务根据死循环检测任务的运行情况判断操作系统中是否存在死循环,如果存在死循环,执行步骤103,否则,跳到步骤107。 [0020] Step 102: The dead cycle monitoring task running endless loop detection task operating system if it is determined whether there is an infinite loop if there is an infinite loop, step 103 is executed, otherwise, jumps to step 107.

[0021] 死循环检测任务每次运行时记录本次运行的当前时刻,死循环监控任务每次运行时,根据当前时刻和死循环检测任务运行时记录的当前时刻,计算出死循环检测任务有多长时间没有运行了,即死循环检测任务未得到调度的时间间隔。 [0021] The recording operation of this time is infinite loop detection task every run cycle of death monitoring tasks for each run, based on the current time of the current recording time and the dead loop detection task runs, the calculated dead loop detection tasks How long is not running, and that is an infinite loop detection time interval task has not been scheduled. 由于死循环检测任务在操作系统中的优先级最低,如果操作系统中不存在死循环任务,那么,死循环检测任务将有可能在其他任务处理完成的情况下得到调度,即:可以在合理长的时间间隔内得到一次调度, 反之,如果死循环检测任务未得到调度的时间间隔比较长,超过了预先设置的阀值,则表明操作系统中有任务出现了死循环或者类死循环。 As the infinite loop detection tasks lowest priority in the operating system, if an infinite loop task does not exist in the operating system, then an infinite loop detection tasks will likely be scheduled in the case of other task processing is completed, namely: can a reasonable period obtained in the next scheduling interval, on the contrary, if the task is not scheduled infinite loop detection time interval longer obtained, exceeds a preset threshold, then the operating system has a task class appears infinite loop or endless loop.

[0022] 步骤103 :判断是否已设置死循环标志,若没有设置,执行步骤104 ;若已经设置, 跳到步骤109。 [0022] Step 103: determining whether the dead loop flag has been set, if not set, step 104 is performed; if it has been set, skip to step 109.

[0023] 步骤104 :为每个优先级设置一个任务列表,并为每个任务列表设置一个优先级控制块,在每个任务的任务控制块中设置任务运行字段,其值置为0 ;其中,每个任务列表中包含操作系统中所有具有相应优先级的任务,每个优先级控制块中包含任务个数字段和任务运行字段,任务个数字段填充相应优先级的任务的总个数,任务运行字段置为0。 [0023] Step 104: setting a priority for each task list, and set a priority for each task control block list, the task set in the task control block field run for each task whose value is set to 0; wherein each task list contains all tasks in an operating system having a respective priority, priority control for each block comprising a number of tasks in the task field and a field operation, the task priority number field is populated with the corresponding total number of tasks, task run field is set to 0.

[0024] 本步骤中,可以通过操作系统接口获取包含操作系统中所有任务的任务控制块列表,并将所有任务按照优先级进行划分,从而得到多个基于优先级的任务列表,如图4所 [0024] In this step, the interface may be acquired by the operating system task control block list contains all tasks in the operating system, and all the tasks are divided according to priority, thereby to obtain a plurality of tasks based on priority lists, as shown in FIG 4

7J\ ο[0025] 其中,任务控制块中的任务运行字段可以由任务控制块中的用户保留字段扩充得到。 7J \ ο [0025] wherein the task control block in the operating field of the task may be retained by a task control block in the user field extension obtained. [0026] 步骤105 :向操作系统注册任务切换钩子函数。 [0026] Step 105: the operating system switch hook function register tasks. [0027] 在操作系统中,每发生一次任务切换,就会调用一次已注册的任务切换钩子函数。 [0027] In the operating system, each time a task switch occurs, it will call a registered task switch hook function. 本发明中,任务切换钩子函数通过优先级索引优先级控制块,当任务切换钩子函数被调用时,其执行以下操作:对本次被调度的任务的任务控制块中的运行字段进行加1操作,并对该任务所属的任务列表的优先级控制块中的任务运行字段进行加1操作。 The present invention, the task switch hook function by priority index priority control block, when a task switch hook function is called, for the following actions: Run field of the task control block of the current task to be scheduled in are incremented , and add the task to run an operating field priority task list task control block belongs. [0028] 步骤106 :设置死循环标志。 [0028] Step 106: Set flag infinite loop. [0029] 这里,死循环标志实际上用于对死循环监控任务所执行的步骤104和步骤105进行标记,设置了死循环标志,表明死循环监控任务已执行步骤104和步骤105,其作用在于节约CPU资源。 [0029] Here, in fact infinite loop flag for step 104 and step death cycle monitoring task performed flag 105, is set dead loop flag indicating infinite loop monitoring tasks have been performed steps 104 and 105, its role is saving CPU resources. [0030] 上述步骤104〜106的执行顺序可以任意调换。 The execution order of [0030] the above steps 104~106 may be arbitrarily exchanged. [0031] 步骤107 :死循环监控任务出让CPU,进入睡眠状态,操作系统中的其他任务得到调度。 [0031] Step 107: the CPU infinite loop transfer monitoring tasks, go to sleep, the operating system other tasks are scheduled. [0032] 由于在非时间片轮转的优先级抢占式操作系统中,只要高优先任务不阻塞或者不主动出让CPU,那么低优先级任务或者与该高优先级任务具有相同优先级的其它任务就不能得到调度,而本发明死循环监控任务只有在操作系统中存在死循环任务时,才会向提供注册任务切换钩子函数,因此,如果已注册任务切换钩子函数,那么,死循环监控任务出让CPU之后,操作系统中只有优先级高于死循环任务优先级的任务和死循环任务才能得到调度,对于得到调度的任务,任务切换钩子函数将对其任务控制块中的运行字段进行加1操作,并对其对应的优先级控制块中的任务运行字段进行加1操作,如此,根据任务控制块运行字段的取值和优先级控制块任务运行字段的取值,死循环任务将得以定位。 [0032] Since the priority preemptive operating system, the non-round-robin, a long high-priority task is not blocked or is not actively transfer the CPU, then the low priority task or have other tasks of the same priority with the high-priority task when can not be scheduled, and the death cycle monitoring task of the invention only if there is an infinite loop task in the operating system, it will switch hook function to provide registration task, therefore, if the registered task switch hook function, then an infinite loop monitoring tasks to sell CPU Thereafter, the operating system, only an endless loop higher priority than the task priority tasks and tasks to be scheduled endless loop, to be scheduled task, the task switch hook function are incremented to its field of operation of the task control block, and adding a task to run its operation corresponding to the priority field in the control block, thus, the value based on the value of the field operation task control block and a block task priority control operation field, the task will be infinite loop positioning. 如果没有注册任务切换钩子函数,表明当前操作系统中并不存在死循环任务,死循环监控任务出让CPU 的目的仅在于令其他优先级的任务能够得以调度,而并非用于对死循环任务进行定位。 If you do not register a task switch hook function, indicating that the operating system does not exist in an infinite loop current mission, the purpose of an infinite loop monitoring task is to sell the CPU only make other priority tasks can be scheduled, but not for an infinite loop positioning tasks . [0033] 步骤108 :当死循环监控任务的睡眠周期到期被唤醒时,死循环监控任务再次得到调度,返回步骤102。 [0033] Step 108: when the infinite loop monitoring task is awakened sleep period expires, dead cycle monitoring task scheduling once again returns to step 102. [0034] 步骤109 :确定死循环任务,具体而言:从最低优先级对应的优先级控制块开始检测,若优先级控制块中的运行字段非0,表明相应优先级的任务出现了死循环,然后检测该优先级对应的任务列表的任务控制块,若检测到某个任务的任务控制块的任务运行字段非0,表明该任务出现了死循环。 [0034] Step 109: determining a task infinite loop, specifically: start detecting the lowest priority corresponding to the priority control block, if the field priority control operation block non-zero, indicates that the corresponding priority task appeared dead cycle and then detects the task control block corresponding to the priority of the task list, the task upon detection of a task control block of the task to run field is not 0, indicating that the task appear in an infinite loop. [0035] 步骤110 :对死循环任务进行处理。 [0035] Step 110: the processing tasks of an endless loop. [0036] 检测出死循环任务后,可以挂起死循环任务或类死循环任务,并使用操作系统工具对出现死循环的任务进行调试和记录,并且,可以利用操作系统提供的标准接口函数分析该任务堆栈,精确定位死循环出现的代码位置,并使用用户接口记录相关信息。 [0036] endless loop after detecting task, the task may be suspended or dead loop endless loop type task, and the task using the operating system tools for debugging infinite loop and recording, and the standard operating system interface function analysis may utilize the task stack, pinpoint the position of the code infinite loop, and the information recorded using the user interface. [0037] 步骤111 :释放资源,具体包括:注销已经注册的任务切换钩子函数,销毁所设置的任务列表,并清除死循环标志,返回步骤107。 [0037] Step 111: the release of resources, including: cancellation of the registered task switch hook function, the task of destroying the set list, and clear signs an infinite loop, returns to step 107. [0038] 至此,结束本较佳方法流程。 [0038] Thus, the preferred method of the present flow ends. [0039] 由上述实施例可见,本发明首先通过周期性运行的死循环监控任务和死循环检测任务确定操作系统中是否存在死循环任务;当存在死循环任务时,通过划分基于优先级的任务列表,设置任务列表的优先级控制块,并注册任务切换钩子函数对被调度任务的控制块及其优先级控制块中的相应字段进行设置,从而实现对死循环任务进行定位。 [0039] seen from the above embodiments, the present invention first determines whether there is an endless loop-task operating system running in an endless loop by periodically monitoring tasks and the infinite loop detection tasks; infinite loop when present task by dividing the task priority-based priority control block list, setting the task list, and task switch hook function register field of the control block and its corresponding priority scheduled task control block is set in order to achieve the task of positioning an endless loop.

[0040] 为避免消耗过多CPU资源,本发明没有使用系统时钟中断服务程序检测死循环, 而是在仅通过耗费CPU资源极低的周期性运行的死循环监控任务和死循环检测任务检测到操作系统中存在死循环后,才向操作系统注册任务切换钩子函数对死循环任务进行定位,并且,任务切换钩子函数中的操作非常简单,对CPU资源的消耗极低,因此,本发明提出的技术方案具有消耗CPU资源少、且实现简单的有益效果。 [0040] To avoid excessive consumption of CPU resources, the present invention does not use a system clock interrupt service routine detects an endless loop, but at low cost only by detecting a CPU resource periodically operating cycle of death monitoring tasks and tasks to the endless loop detected after the operating system, there is a dead cycle, before switching to the operating system the task register dead hook function loop positioning task, and the task switching function hook operation is very simple, CPU resources consumption is very low, therefore, the present invention provides technical solutions have consumed less CPU resources, and the simple benefits.

[0041] 以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。 [0041] The foregoing is only preferred embodiments of the present invention but are not intended to limit the present invention, all within the spirit and principle of the present invention, any changes made, equivalent substitutions and improvements should be included within the scope of protection of the present invention.

Claims (9)

1. 一种检测死循环任务的方法,适用于基于优先级对任务进行调度的操作系统,其特征在于:A、生成具有最高优先级的死循环监控任务和具有最低优先级的死循环检测任务,死循环监控任务和死循环检测任务周期性运行;B、死循环检测任务每次运行时记录当前时刻;C、死循环监控任务每次运行时,根据死循环检测任务的运行情况判断操作系统中是否存在死循环任务,在判定系统中存在死循环任务时,对死循环任务进行定位,并对定位到的死循环任务进行处理。 CLAIMS 1. A method for detecting dead cycle task, the task for the operating system of priority-based scheduling, wherein: A, generated with the highest priority and the infinite loop monitoring tasks with the lowest priority infinite loop detection task death monitoring tasks and infinite loop detection tasks run periodically; B, infinite loop detection task runs each time the current record; C, death cycle monitoring task for each run, the operating system is determined according to the operating conditions of an infinite loop detection tasks when the existence of an infinite loop in the task, there is an infinite loop in task determination system, the infinite loop task to locate, navigate to the cycle of death and task processing.
2.根据权利要求1所述的方法,其特征在于,所述C中根据死循环检测任务的运行情况判断操作系统中是否存在死循环为:根据当前时刻和死循环检测任务运行时记录的当前时刻,计算死循环检测任务未得到调度的时间间隔,如果所述时间间隔超过预先设置的阈值,判定操作系统中存在死循环。 2. The method according to claim 1, characterized in that the operating system C is determined whether there is an infinite loop operation according to an infinite loop detection tasks: the operation of the current record and the current dead time loop detection task time, calculating an infinite loop detection tasks have not been scheduled intervals, if the time interval exceeds the preset threshold value, it is determined there is a dead cycle of the operating system.
3.根据权利要求1或2所述的方法,其特征在于,所述对死循环任务进行定位包括:D、判断是否已设置死循环标志,若没有设置,执行E,否则,跳到H ;E、为每个优先级设置一个任务列表,并为每个任务列表设置一个优先级控制块,在每个任务的任务控制块中设置任务运行字段,其值置为0,向操作系统注册任务切换钩子函数,并设置死循环标志;其中,每个任务列表中包含操作系统中所有具有相应优先级的任务,每个优先级控制块中包含任务运行字段,其值置为0 ;任务切换钩子函数被调用时,对本次被调度的任务的任务控制块的任务运行字段进行加1操作,并对该任务所属的任务列表的优先级控制块中的任务运行字段进行加1操作;F、死循环监控任务出让CPU,进入睡眠状态;G、当死循环监控任务的睡眠周期到期被唤醒时,死循环监控任务再次得到调 3. The method of claim 1 or claim 2, characterized in that said endless loop comprises positioning tasks: D, an infinite loop is determined whether flag has been set, if not set, performing E, otherwise, jump to H; E, for each priority a task list, a list is provided for each task and a priority control block, the task control block is provided for each task in the task to run field whose value is set to 0, the operating system task register switch hook function, and sets the flag infinite loop; wherein each task list contains all tasks in an operating system having a corresponding priority, the priority of each task control block comprises run field whose value is set to 0; task switching hooks when the function is called, the task of this task to be scheduled task control block operating field are incremented, and the operation of adding a field to run the task control block priority task list in a task belongs; F, infinite loop monitoring tasks to sell the CPU, go to sleep; G, when the infinite loop control and monitoring tasks to be awakened sleep period expires, an infinite loop monitoring tasks once again tune 度,返回C ;H、从最低优先级对应的优先级控制块开始检测,对于优先级控制块中的运行字段非0 的优先级,继续检测该优先级对应的任务列表的任务控制块,将任务控制块的任务运行字段非0的任务确定为死循环任务。 Degrees, returns C; H, from the lowest priority corresponding to the priority control block starts to detect, for the operation of field priority control block of non-priority, continue to detect the priority of the corresponding task list task control block 0, the task control block field task runs the task 0 as the non-dead cycle task.
4.根据权利要求3所述的方法,其特征在于:所述C中在判定系统中不存在死循环任务时,跳到F。 4. The method according to claim 3, wherein: said infinite loop in the task C does not exist in the determination system, skip F.
5.根据权利要求3所述的方法,其特征在于,在对死循环任务进行处理之后进一步包括:注销已注册的任务切换钩子函数,销毁所设置的任务列表,并清除死循环标志,返回F。 5. The method according to claim 3, characterized in that, further comprising a pair of endless loop after processing tasks: task switching cancellation registered hook function, the task of destroying the list provided, and clear the flag infinite loop, returns F .
6.根据权利要求3所述的方法,其特征在于,所述对定位到的死循环任务进行处理包括:挂起死循环任务。 6. The method according to claim 3, wherein said endless loop positioning to process the task comprising: an endless loop pending tasks.
7.根据权利要求6所述的方法,其特征在于,在挂起死循环任务之后,进一步包括: 对挂起的死循环任务进行调试,定位死循环出现的代码位置,并记录相关信息。 7. The method according to claim 6, characterized in that, after a dead cycle pending tasks, further comprising: an endless loop of tasks pending for debugging, code location positioning infinite loop and record information.
8.根据权利要求3所述的方法,其特征在于,所述E中为每个优先级设置一个任务列表包括:通过操作系统接口获取包含操作系统中所有任务的任务控制块列表,将所有任务按照优先级进行划分,得到对应于每个优先级的任务列表。 8. The method according to claim 3, wherein the E is provided for each task a priority list comprising: acquisition task control block list contains all tasks in the operating system through the operating system interface, all tasks divided according to priorities, corresponding to each give priority task list.
9.根据权利要求1或2所述的方法,其特征在于, 所述死循环监控任务的睡眠周期比所述死循环检测任务的睡眠周期长。 9. The method of claim 1 or claim 2, wherein said endless loop monitoring task sleep cycle longer than the assignment cycle of death detecting sleep cycle.
CN 201110356415 2011-11-11 2011-11-11 Method for detecting endless loop task CN102495793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110356415 CN102495793B (en) 2011-11-11 2011-11-11 Method for detecting endless loop task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110356415 CN102495793B (en) 2011-11-11 2011-11-11 Method for detecting endless loop task

Publications (2)

Publication Number Publication Date
CN102495793A true true CN102495793A (en) 2012-06-13
CN102495793B CN102495793B (en) 2014-11-05

Family

ID=46187618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110356415 CN102495793B (en) 2011-11-11 2011-11-11 Method for detecting endless loop task

Country Status (1)

Country Link
CN (1) CN102495793B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5450586A (en) * 1991-08-14 1995-09-12 Hewlett-Packard Company System for analyzing and debugging embedded software through dynamic and interactive use of code markers
CN1811730A (en) * 2006-02-22 2006-08-02 迈普(四川)通信技术有限公司 Method for testing closed loop or similar closed loop task
CN101853191A (en) * 2010-06-23 2010-10-06 迈普通信技术股份有限公司 Method for detecting task endless loop in operating system and operating system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5450586A (en) * 1991-08-14 1995-09-12 Hewlett-Packard Company System for analyzing and debugging embedded software through dynamic and interactive use of code markers
CN1811730A (en) * 2006-02-22 2006-08-02 迈普(四川)通信技术有限公司 Method for testing closed loop or similar closed loop task
CN101853191A (en) * 2010-06-23 2010-10-06 迈普通信技术股份有限公司 Method for detecting task endless loop in operating system and operating system

Also Published As

Publication number Publication date Type
CN102495793B (en) 2014-11-05 grant

Similar Documents

Publication Publication Date Title
US20070214342A1 (en) System to profile and optimize user software in a managed run-time environment
US20070074217A1 (en) Scheduling optimizations for user-level threads
US7287173B2 (en) Method for computing power consumption levels of instruction and recompiling the program to reduce the excess power consumption
US20090150696A1 (en) Transitioning a processor package to a low power state
US20090055826A1 (en) Multicore Processor Having Storage for Core-Specific Operational Data
Rountree et al. Adagio: making DVS practical for complex HPC applications
US20130155081A1 (en) Power management in multiple processor system
Klues et al. Integrating concurrency control and energy management in device drivers
US20060282839A1 (en) Mechanism for monitoring instruction set based thread execution on a plurality of instruction sequencers
Lim et al. Adaptive, transparent frequency and voltage scaling of communication phases in mpi programs
US20100218183A1 (en) Power-saving operating system for virtual environment
McCartney et al. Abstractions for safe concurrent programming in networked embedded systems
Shen et al. Power containers: An OS facility for fine-grained power and energy management on multicore servers
Bower et al. The impact of dynamically heterogeneous multicore processors on thread scheduling
US20110145616A1 (en) System and method for controlling central processing unit power in a virtualized system
US20110093857A1 (en) Multi-Threaded Processors and Multi-Processor Systems Comprising Shared Resources
Chantem et al. Online work maximization under a peak temperature constraint
US20110307887A1 (en) Dynamic virtual machine shutdown without service interruptions
JP2000039937A (en) Computer system and its power-saving control method
US20120210104A1 (en) Suspendable interrupts for processor idle management
US20050050310A1 (en) Method, system, and apparatus for improving multi-core processor performance
US20120278594A1 (en) Performance bottleneck identification tool
CN102043667A (en) Task scheduling method for embedded operating system
US20140059372A1 (en) Method and apparatus to save power upon resume in multi-core system
US20150026687A1 (en) Monitoring system noises in parallel computer systems

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model