CN1324478C - Method and system for thread deadlock detection of multithread processor - Google Patents
Method and system for thread deadlock detection of multithread processor Download PDFInfo
- Publication number
- CN1324478C CN1324478C CNB2003101239806A CN200310123980A CN1324478C CN 1324478 C CN1324478 C CN 1324478C CN B2003101239806 A CNB2003101239806 A CN B2003101239806A CN 200310123980 A CN200310123980 A CN 200310123980A CN 1324478 C CN1324478 C CN 1324478C
- Authority
- CN
- China
- Prior art keywords
- thread
- multiline procedure
- procedure processor
- deadlock
- count value
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
Images
Abstract
The present invention relates to a method and a system for thread deadlock detection of a multithread processor. The present invention has the technical scheme that a data storage device is used to store count value of each thread by a counter, and thus, a detection device can detect in a real time that whether thread deadlock phenomenon occurs only by periodically detecting the stored count value. Therefore, the present invention provides an easy and fast thread deadlock detection means, a thread processor having thread deadlock phenomenon can be rapidly processed correspondingly so as to avoid overall system paralysis caused by the phenomenon of thread deadlock, and the robustness of the system is enhanced.
Description
Technical field
The present invention relates to field of computer technology, relate in particular to method and system thereof that a kind of multiline procedure processor thread deadlock detects.
Background technology
Along with development of computer, the technology of multiline procedure processor is used very extensive at present; Described thread is meant an implementation of program, and described multithreading is meant that then same program can have the path of several concurrent execution, and these thread shared drive address spaces can concurrent asynchronous execution.According to the design difference of processor producer, the design of the multithreading of processor can also can realize by software design by the hardware design support, no matter any final be purpose still to improve resource utilization ratio and to improve handling property.So the application of multithreading has improved the utilization factor of resource for computer system greatly, also improved the speed of the execution and the processing of system simultaneously.
But thread deadlock is a very fatal problem in the application of multithreading.Described thread deadlock is meant that each is all waiting for that wherein another thread discharges resource and is blocked in two or more threads, and they all can't be pushed ahead, and this phenomenon is a thread deadlock.Thread deadlock all can cause the total system paralysis usually.The factor that triggers thread deadlock is a lot, and the design problem of software program itself is arranged, and the hardware design problem of processor itself is also arranged.For avoiding thread deadlock that total system is caused significant impact, the robustness of raising system needs an effective detection method and detects thread deadlock, with timely discovery thread deadlock, and adopt the corresponding techniques means to adjust, avoid the further deterioration of system running state.
Based on above-mentioned needs, adopt the real-time monitoring of mode of reporting message bag whether the thread deadlock phenomenon takes place at present usually.Concrete processing procedure is: each thread CPU (central processing unit) regularly gives the CPU reporting message that detects, thread CPU for overtime not reporting message, detect CPU and can think that the thread of this thread CPU dies, if untimely processing will further cause serious problem, therefore, be responsible for this thread CPU is carried out reset operation by detecting CPU.
The device of currently used monitoring thread deadlock as shown in Figure 1, as can be seen, each thread CPU all needs and detects CPU and link to each other, and causes detecting the complex interfaces between CPU and the thread CPU; And when the thread CPU of system was many, thread CPU and the message traffic that detects between the CPU increased greatly, and this will inevitably increase the Message Processing burden that detects CPU.Simultaneously, owing to be to adopt message mode to carry out the transmission of information between the interface, when message transmits bigger delay of appearance or information drop-out, will cause detecting the disconnected and maloperation of CPU erroneous judgement, thereby make that the reliability of total system can't be guaranteed well.
Summary of the invention
The method and the system thereof that the purpose of this invention is to provide a kind of multiline procedure processor Deadlock Detection can be easy thereby make, effectively the thread deadlock phenomenon is detected, and guarantee the good operation of system.
The objective of the invention is to realize by the following technical solutions:
The invention provides the method that a kind of multiline procedure processor thread deadlock detects, comprising:
A, set up corresponding counter respectively for each thread of multiline procedure processor, multiline procedure processor is carried out each time, and then the counter of Dui Ying thread is counted;
B, regularly detect the rolling counters forward value of each thread of multiline procedure processor, and according to the count value of the counter of each thread during with last detection the count value of corresponding thread whether whether identical definite multiline procedure processor thread deadlock takes place.
Described steps A also comprises:
The rolling counters forward value of each thread of multiline procedure processor is preserved.
Described step B also comprises:
Rolling counters forward value when this of each thread of preserving the multiline procedure processor that thread deadlock does not take place detects.
The present invention also provides a kind of detection system of multiline procedure processor thread deadlock, comprise multiline procedure processor counting equipment, data storage device and checkout equipment, wherein: the multiline procedure processor counting equipment, be used for the number of times of each thread execution of multiline procedure processor is counted, and corresponding count value is stored in the data storage device; Data storage device is used to preserve the count value of multiline procedure processor counting equipment of each thread of multiline procedure processor; Checkout equipment is used for regularly obtaining the count value of the multiline procedure processor counting equipment of each thread that data storage device preserves, and judges whether to take place thread deadlock according to the corresponding last count value of this value and its is whether identical.
Described checkout equipment is to be provided with separately, perhaps is arranged in the existing processor.
Described checkout equipment further comprises:
The history data store module: be used for the count value of the multiline procedure processor counting equipment of each thread when the thread deadlock detection module provides the last time of preservation to detect, and the count value that the multiline procedure processor counting equipment of the thread that thread deadlock does not take place that provides by data storage device in this testing process is provided;
The thread deadlock detection module: the count value of the multiline procedure processor counting equipment of each thread when last time that provides according to data storage device is detected, and the count value of the multiline procedure processor counting equipment of each thread of this detection of providing of data storage device determines whether to take place thread deadlock.
Described data storage device is to be provided with separately, or is built in multiline procedure processor or the checkout equipment.
Described multiline procedure processor counting equipment perhaps is provided with separately for being arranged in the processor, perhaps concentrates with checkout equipment or data storage device to be set to a device.
Described multiline procedure processor counting equipment is for being arranged in the multiline procedure processor.
By technique scheme as can be seen, adopted a data memory device to preserve technical scheme among the present invention at the rolling counters forward value of each thread, like this, checkout equipment only need detect regularly promptly can real-time monitor whether the thread deadlock phenomenon takes place to the count value of preserving.Therefore, the invention provides a kind of simple, fast thread deadlock detection means, thereby can handle accordingly the thread processor that the thread deadlock phenomenon takes place apace, because the appearance of thread deadlock phenomenon causes the total system paralysis, improve the robustness of system to avoid.
Description of drawings
Fig. 1 is the structural representation of multiline procedure processor thread deadlock pick-up unit in the prior art;
Fig. 2 is the method flow diagram that multiline procedure processor thread deadlock of the present invention detects;
Fig. 3 is the structural representation of system of the present invention.
Embodiment
In existing communication system, big multiprocessor all is to adopt the multithreading treatment technology to improve the handling property of system.Yet, in the system applies of reality, the thread deadlock problem of multiline procedure processor usually causes the fault of system operation, and thread deadlock all is because the software design problem of system itself causes or owing to self design problem of hardware of processor production firm causes usually.So must there be an effective detection method in system, guarantee the stable of system's operation.Purpose of the present invention is the method that provides a kind of multiline procedure processor thread deadlock to detect, and this method Interface design is simple, handle easy, reliable and accurately, to overcome the existing shortcoming of multiline procedure processor deadlock detection method used in the prior art.
The method that multiline procedure processor thread deadlock of the present invention detects specifically may further comprise the steps as shown in Figure 3:
Step 21: for each thread of multiline procedure processor is set up corresponding counter, the implementation status that is used to add up each thread respectively;
Step 22: each thread of multiline procedure processor is carried out each time, and then the counter of Dui Ying thread is counted, promptly some thread execution once, then the rolling counters forward value of this thread adds 1;
Step 23: preserve the rolling counters forward value of each thread of multiline procedure processor, so that determine whether to take place thread deadlock according to the rolling counters forward value of real-time preservation;
Step 24: regularly detect the rolling counters forward value of each thread of multiline procedure processor, reach the rolling counters forward value of each thread of the multiline procedure processor that regularly obtains preservation;
Step 25: the count value of each corresponding thread was identical when whether the count value of judging the counter of each thread when this detects detected with the last time, if identical, execution in step 26, otherwise, execution in step 27;
This step is generally the detection whether each thread thread deadlock takes place one by one, and the count value when whether the count value of promptly judging each thread successively detects with the last time is identical, to determine each whether thread deadlock takes place respectively;
Step 26: determine its respective thread generation thread deadlock of multiline procedure processor, and multiline procedure processor is handled accordingly;
After determining certain thread generation deadlock of multiline procedure processor, then need carry out reset processing to this multiline procedure processor usually, can certainly adopt other disposal route, the concrete disposal route that adopts is definite according to being provided with of computer system;
Step 27: determine thread deadlock does not take place, and execution in step 28;
Step 28: the rolling counters forward value of each thread when preserving this and detecting, the rolling counters forward value of each thread when this of each thread of promptly preserving the multiline procedure processor that thread deadlock does not take place detects, so that use when detecting, and execution in step 24 next time.
By said process as can be seen, circulation execution in step 24 to step 28 promptly can realize to multiline procedure processor carry out accurately, reliably thread deadlock detects, so that in time find the thread deadlock phenomenon, in time handle, avoiding causing great influence, as cause total system paralysis etc. to total system.
Based on said method, the present invention also provides a kind of detection system of multiline procedure processor thread deadlock, as shown in Figure 3, specifically comprises:
Checkout equipment: the rolling counters forward value that is used for regularly obtaining each thread that data storage device preserves, and judge whether to take place thread deadlock according to this value and corresponding last count value thereof, if promptly the rolling counters forward value of twice a certain thread of detection does not change, think that then thread deadlock has taken place this thread, otherwise, think that this thread work is normal;
Described checkout equipment or setting separately perhaps be arranged in the existing processor of computer system at place, and described checkout equipment further comprise:
The history data store module: be used for the rolling counters forward value of each thread when the thread deadlock detection module provides the last time of preservation to detect, and the rolling counters forward value that the thread that thread deadlock does not take place that provides by data storage device in this testing process is provided;
The thread deadlock detection module: the rolling counters forward value of each thread when last time that provides according to data storage device is detected, and the rolling counters forward value of each thread of this detection of providing of data storage device determines whether to take place thread deadlock;
Promptly carry out thread when extremely detecting when needs, at first obtain the rolling counters forward value of current each thread of its preservation to data storage device by the thread deadlock detection module, rolling counters forward value as each thread of this detection, and call the rolling counters forward value of last time of preserving in the history data store module each thread when detecting, and determine whether to take place thread deadlock according to two count values are whether identical, need be stored in the rolling counters forward value of each thread when replacing last the detection in the history data store module for the rolling counters forward value of the thread of this detection of the thread correspondence that thread deadlock does not take place, promptly refresh the count value that the thread of thread deadlock does not take place in the history data store module.
Data storage device: the rolling counters forward value that is used to preserve each thread of multiline procedure processor; Described data storage device is to be provided with separately, or is built in multiline procedure processor or the checkout equipment.
Multiline procedure processor counting equipment: be used for the number of times of each thread execution of multiline procedure processor is counted, and corresponding count value is stored in the data storage device; Described multithreading is carried out counting equipment for being arranged in the existing processor, perhaps is provided with separately, and for example, described multithreading is carried out counting equipment and can be arranged in the multiline procedure processor.
In the detection system of stating of the present invention, described checkout equipment, data storage device and multiline procedure processor counting equipment can be concentrated or disperse to be provided with as required, for example, with the concentrated individual devices that is set to of checkout equipment, data storage device and multiline procedure processor counting equipment, perhaps checkout equipment, data storage device and multiline procedure processor counting equipment two kinds of equipment are wherein concentrated, disperse to be provided with another kind of equipment, perhaps checkout equipment, data storage device and multiline procedure processor counting equipment are disperseed respectively to be provided with.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.
Claims (9)
1, a kind of method of multiline procedure processor thread deadlock detection is characterized in that comprising:
A, set up corresponding counter respectively for each thread of multiline procedure processor, multiline procedure processor is carried out each time, and then the counter of Dui Ying thread is counted;
B, regularly detect the rolling counters forward value of each thread of multiline procedure processor, and according to the count value of the counter of each thread during with last detection the count value of corresponding thread whether whether identical definite multiline procedure processor thread deadlock takes place.
2, the detection method of multiline procedure processor thread deadlock according to claim 1 is characterized in that described steps A also comprises:
The rolling counters forward value of each thread of multiline procedure processor is preserved.
3, the detection method of multiline procedure processor thread deadlock according to claim 1 and 2 is characterized in that described step B also comprises:
Rolling counters forward value when this of each thread of preserving the multiline procedure processor that thread deadlock does not take place detects.
4, a kind of detection system of multiline procedure processor thread deadlock is characterized in that comprising multiline procedure processor counting equipment, data storage device and checkout equipment, wherein:
Multiline procedure processor counting equipment: be used for the number of times of each thread execution of multiline procedure processor is counted, and corresponding count value is stored in the data storage device;
Data storage device: the count value of multiline procedure processor counting equipment that is used to preserve each thread of multiline procedure processor;
Checkout equipment: be used for regularly obtaining the count value of the multiline procedure processor counting equipment of each thread that data storage device preserves, and judge whether to take place thread deadlock according to the corresponding last count value of this value and its is whether identical.
5, the detection system of multiline procedure processor thread deadlock according to claim 4 is characterized in that described checkout equipment for being provided with separately, perhaps is arranged in the existing processor.
6,, it is characterized in that described checkout equipment further comprises according to the detection system of claim 4 or 5 described multiline procedure processor thread deadlocks:
The history data store module: be used for the count value of the multiline procedure processor counting equipment of each thread when the thread deadlock detection module provides the last time of preservation to detect, and the count value that the multiline procedure processor counting equipment of the thread that thread deadlock does not take place that provides by data storage device in this testing process is provided;
The thread deadlock detection module: the count value of the multiline procedure processor counting equipment of each thread when last time that provides according to data storage device is detected, and the count value of the multiline procedure processor counting equipment of each thread of this detection of providing of data storage device determines whether to take place thread deadlock.
7, the detection system of multiline procedure processor thread deadlock according to claim 6 is characterized in that described data storage device is setting separately, or is built in multiline procedure processor or the checkout equipment.
8, the detection system of multiline procedure processor thread deadlock according to claim 7, it is characterized in that described multiline procedure processor counting equipment is for being arranged in the processor, perhaps be provided with separately, perhaps concentrate to be set to a device with checkout equipment or data storage device.
9, the detection system of multiline procedure processor thread deadlock according to claim 8 is characterized in that described multiline procedure processor counting equipment is for being arranged in the multiline procedure processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2003101239806A CN1324478C (en) | 2003-12-19 | 2003-12-19 | Method and system for thread deadlock detection of multithread processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2003101239806A CN1324478C (en) | 2003-12-19 | 2003-12-19 | Method and system for thread deadlock detection of multithread processor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1629821A CN1629821A (en) | 2005-06-22 |
CN1324478C true CN1324478C (en) | 2007-07-04 |
Family
ID=34844912
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2003101239806A Expired - Fee Related CN1324478C (en) | 2003-12-19 | 2003-12-19 | Method and system for thread deadlock detection of multithread processor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1324478C (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819466B (en) * | 2012-06-29 | 2015-08-19 | 华为技术有限公司 | The disposal route of operating system exception and device thereof |
CN103279417A (en) * | 2013-06-05 | 2013-09-04 | 福州瑞芯微电子有限公司 | Methods and device for detecting abnormal locking |
CN103678122B (en) * | 2013-11-29 | 2016-03-30 | 华为技术有限公司 | A kind of deadlock detection method, equipment and system |
CN103761182A (en) * | 2013-12-26 | 2014-04-30 | 上海华为技术有限公司 | Method and device for deadlock detection |
CN104636259B (en) * | 2015-03-18 | 2020-05-22 | 厦门雅迅网络股份有限公司 | Function execution timeout and deadlock detection method based on dynamic tracking of operation period |
CN106020962B (en) * | 2016-05-31 | 2019-05-21 | Oppo广东移动通信有限公司 | A kind of course control method and terminal device |
CN107247630A (en) * | 2017-06-05 | 2017-10-13 | 努比亚技术有限公司 | Thread detection method, terminal and computer-readable recording medium |
CN109271298B (en) * | 2018-11-19 | 2023-04-07 | 武汉达梦数据库股份有限公司 | Method for detecting database non-response fault |
CN111090528B (en) * | 2019-12-25 | 2023-09-26 | 北京天融信网络安全技术有限公司 | Deadlock determination method and device and electronic equipment |
CN113407414A (en) * | 2021-06-24 | 2021-09-17 | 厦门科灿信息技术有限公司 | Program operation monitoring method, device, terminal and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5016167A (en) * | 1987-12-21 | 1991-05-14 | Amdahl Corporation | Resource contention deadlock detection and prevention |
CN1289962A (en) * | 1999-09-23 | 2001-04-04 | 国际商业机器公司 | Establishment of multiple process spanned communication programme in multiple linear equation running environment |
CN1297198A (en) * | 1999-11-18 | 2001-05-30 | 国际商业机器公司 | Method, system and program product for managing computing environment thread pool to prevent dead-locking |
US6631009B1 (en) * | 1999-09-24 | 2003-10-07 | Xerox Corporation | Avoiding deadlock situations in a printing system using a locking time-out mechanism |
-
2003
- 2003-12-19 CN CNB2003101239806A patent/CN1324478C/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5016167A (en) * | 1987-12-21 | 1991-05-14 | Amdahl Corporation | Resource contention deadlock detection and prevention |
CN1289962A (en) * | 1999-09-23 | 2001-04-04 | 国际商业机器公司 | Establishment of multiple process spanned communication programme in multiple linear equation running environment |
US6631009B1 (en) * | 1999-09-24 | 2003-10-07 | Xerox Corporation | Avoiding deadlock situations in a printing system using a locking time-out mechanism |
CN1297198A (en) * | 1999-11-18 | 2001-05-30 | 国际商业机器公司 | Method, system and program product for managing computing environment thread pool to prevent dead-locking |
Also Published As
Publication number | Publication date |
---|---|
CN1629821A (en) | 2005-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1324478C (en) | Method and system for thread deadlock detection of multithread processor | |
CN101377750B (en) | System and method for cluster fault toleration | |
US6012148A (en) | Programmable error detect/mask utilizing bus history stack | |
US9367374B2 (en) | Handling system interrupts with long running recovery actions | |
CN1902598A (en) | Dynamic performance monitoring-based approach to memory management | |
CN105243004A (en) | Failure resource detection method and apparatus | |
CN109656895B (en) | Distributed storage system, data writing method, device and storage medium | |
CN1109976C (en) | Monitoring timer system | |
CN1908906A (en) | Method for monitoring software operation state | |
DE112020000146T5 (en) | HANDLING AN INPUT / OUTPUT STORAGE INSTRUCTION | |
CN1851826A (en) | Random storage failure detection processing method and its system | |
CN1574785A (en) | Method and system for maintenance of packet order using caching | |
EP2328322A1 (en) | Method and apparatus for accessing files stored in a storage access network (SAN) or network attached storange (NAS) | |
CN1286429A (en) | Test and monitor method for embedded in processor memory | |
US7493615B2 (en) | Apparatus and method for synchronizing multiple threads in an out-of-order microprocessor | |
CN1776644A (en) | Method for monitoring internal memory varible rewrite based on finite-state-machine | |
CN101038564A (en) | Application server classification regeneration method | |
CN1924810A (en) | Distributed control method in priority for operation process | |
CN106502811A (en) | A kind of 1553B bus communications fault handling method | |
CN1477512A (en) | Embedded sorftware task endless loop monitoring method | |
CN101055556A (en) | Multiple CPU system and method for passing information between CPU | |
CN101048754A (en) | Method and device for distributing data from at least data source in multiprocessor system | |
CN111240936A (en) | Data integrity checking method and equipment | |
CN111159051A (en) | Deadlock detection method and device, electronic equipment and readable storage medium | |
CN1756377A (en) | Method for detecting single board fault |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20070704 Termination date: 20151219 |
|
EXPY | Termination of patent right or utility model |