CN1605987A - Method for realizing real time threads state monitoring in multiple thread system - Google Patents

Method for realizing real time threads state monitoring in multiple thread system Download PDF

Info

Publication number
CN1605987A
CN1605987A CN 200410009809 CN200410009809A CN1605987A CN 1605987 A CN1605987 A CN 1605987A CN 200410009809 CN200410009809 CN 200410009809 CN 200410009809 A CN200410009809 A CN 200410009809A CN 1605987 A CN1605987 A CN 1605987A
Authority
CN
China
Prior art keywords
thread
monitoring
monitored
state
real time
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.)
Granted
Application number
CN 200410009809
Other languages
Chinese (zh)
Other versions
CN1295612C (en
Inventor
彭军
胡静波
陈继华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CNB2004100098097A priority Critical patent/CN1295612C/en
Publication of CN1605987A publication Critical patent/CN1605987A/en
Application granted granted Critical
Publication of CN1295612C publication Critical patent/CN1295612C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method for realizing real time threads state monitoring in multiple thread system which comprises, setting one thread in a multiple thread system as a monitoring thread, the others being monitored threads, wherein the monitoring thread is used for contacting each monitored threads to know their operating modes, each monitored thread responding the message from the monitoring thread, and feeding back the working condition and other information of itself, the monitoring thread maintaining the thread status information chart, and the system employing different strategy according to the status of each thread.

Description

Realize the method for each thread state of monitoring in real time in a kind of multi-threaded system
Technical field
The present invention relates to the multithreading of computer realm, relate in particular to and realize the method for each thread state of monitoring in real time in the multi-threaded system.
Background technology
Along with development of science and technology, in the performance history of large scale system, often need use multithreading.In the multi-threaded system of a complexity, a plurality of threads need collaborative work, and this is individual relatively difficult task.Coordinate the cooperative workload of each thread and in the whole system operation amount, occupy sizable ratio, and algorithm is complicated.Because it is in service in system, any abnormal conditions all might take place, if thread deadlock or take place unusual, but the master control thread is not also known, and arrange task still regularly for this thread, so just cause the task buffering to overflow easily, and then cause service fail, reduce the reliability of total system.This is intolerable for telecommunications, bank etc. to the very high system of reliability requirement.
At present, do not retrieve the open source literature of discussing and addressing the above problem as yet.
Summary of the invention
The purpose of this invention is to provide in a kind of multi-threaded system and to realize the method for each thread state of monitoring in real time, so that multi-threaded system is coordinated each thread collaborative work more efficiently, and to the timely location apace of the problem that occurs.
Realize the method for each thread state of monitoring in real time in the multi-threaded system provided by the present invention, comprise the steps:
Step 1: at least one thread in the multi-threaded system is set at monitoring thread, and other thread is as monitored thread, and described monitoring thread is used for regularly getting in touch with monitored thread, to know the duty of each monitored thread;
Step 2: described monitoring thread is safeguarded the information table of each monitored thread state;
Step 3: system obtains the state of each monitored thread, and takes corresponding processing mode according to the different conditions of monitored thread.
According to said method of the present invention, wherein said monitoring thread can be taken on by the master control thread of system, also can be by a thread sole duty as monitoring thread.
According to said method of the present invention, the master control thread of system is known the state of each monitored thread by the mode that call back function or reception monitoring thread notification message are set; Perhaps the master control thread of system is by initiatively asking for the state of current monitored thread to monitoring thread.
According to said method of the present invention, system takes appropriate measures at the different conditions of monitored thread, as restart monitored thread, reinitialize monitored thread, non-distributed tasks is given monitored thread, reset system or trigger alarm notification user etc.
According to said method of the present invention, in described step 1, monitoring thread regularly triggers the roll-call incident by timer is set, and sends roll-call message for all monitored threads, and the overtime length of wait acknowledge is set; Call the roll to reply when monitored thread and take place when overtime, monitoring thread this monitored thread expired times that add up then, if this monitored thread expired times surpass the number of times of presetting, then monitoring thread should be made as ossified state by monitored thread state, and reporting system; And in overtime length limit, call the roll the information feedback of replying and will comprise this thread work state when giving monitoring thread when monitored thread, and then entering described step 2, monitoring thread is provided with and preserves the state of this monitored thread according to replying of receiving; If at this moment monitored thread state changes, then in described step 3: monitoring thread feeds back to system with the variable condition of monitored thread, and system handles this monitored thread and expired times clear 0 that will this monitored thread.
According to said method of the present invention, in described step 1, monitored thread sends report message to monitoring thread when making a difference the incident of this thread state.
According to said method of the present invention, in described step 1, monitored thread sends report message to monitoring thread when making a difference the incident of this thread state; Simultaneously monitored thread is monitored the roll-call message of regularly sending from monitoring thread, and after receiving roll-call message, in time the state according to self sends response message to monitoring thread, has the parameter of the state of representing this monitored thread in response message.
According to said method of the present invention, there is its state of record whether unusual zone bit takes place in the described monitored thread; Have this zone bit in the described response message.
Because the present invention divides into two kinds of monitoring thread and monitored threads with multithreading, make the multi-threaded system clear in structure, the division of labor is clear and definite, adopt this mode, the master control thread can in time be understood the state of each thread, thereby can coordinate each thread collaborative work more efficiently, and measures areput is in time located and take to the problem that occurs apace, improve the reliability of total system.In addition, because the agreement between monitoring thread and the monitored thread is simple, so the present invention is easy to realize.
Description of drawings
Fig. 1 shows in the multi-threaded system and realizes the method for each thread state of monitoring in real time by the mechanism of calling the roll;
Fig. 2 shows in the multi-threaded system and realizes the method for each thread state of monitoring in real time by report mechanism.
Embodiment
Describe the present invention in detail below in conjunction with accompanying drawing.
At first need determine two types thread in the system of multithreading, a kind of is monitoring thread, and a kind of is monitored thread.Monitoring thread and monitored thread can using system any thread take on.The main task of monitoring thread is regularly to get in touch with monitored thread, the report message of obtaining the state of all monitored threads and monitoring monitored thread uses the master control thread as monitoring thread generally speaking, also can use a thread sole duty as any other thread in monitoring thread or the use task as monitoring thread.And monitored thread generally is the worker thread in the multi-threaded system.
Roll-call is meant that monitoring thread initiatively sends message to monitored thread, obtains monitored thread state by acknowledgement messaging.Report is meant the state of monitored thread active to monitoring thread report oneself.Wherein call the roll and initiate by monitoring thread.Report is initiated by monitored thread.
Fig. 1 shows in the multi-threaded system and realizes the method for each thread state of monitoring in real time by the mechanism of calling the roll.In Fig. 1, monitoring thread regularly triggers the roll-call incident by timer is set, and sends roll-call message for all monitored threads, and the overtime length of wait acknowledge is set.If do not have overtimely,, form the status information table of this monitored thread then according to the state of receiving that is provided with and preserves this monitored thread of replying.If monitored thread state changes, then can feed back to system by modes such as call back functions as required, according to circumstances take different measures by system, and with the expired times of this thread clear 0.If it is overtime that generation is replied in certain monitored thread roll-call, these monitored thread expired times that then add up if these monitored thread expired times surpass default number of times, then should be made as ossified state by monitored thread state, and reporting system.
Fig. 2 shows in the multi-threaded system and realizes the method for each thread state of monitoring in real time by report mechanism.Monitored thread starts, stops, takes place unusual etc. in this thread state incident that makes a difference such as thread, send report message to monitoring thread.Monitoring thread receives report message, and is provided with, preserves the state of this monitored thread, forms the status information table of this monitored thread.Then, monitoring thread feeds back to system by modes such as call back function or transmission message as required with the state variation of monitored thread, according to circumstances takes different measures by system.
In addition, roll-call and report mechanism can also be used simultaneously.Particularly, monitored thread starts, stops, takes place unusual etc. in this thread state incident that makes a difference such as thread, send report message to monitoring thread.Simultaneously, monitored thread is monitored the roll-call message from monitoring thread always, receive roll-call message after, in time the state according to self sends response message to monitoring thread, should have the parameter of this thread state in response message.As, in monitored thread, there is record whether unusual zone bit takes place, have this zone bit in the response message and represent whether this monitored thread took place unusual.Monitoring thread is provided with, preserves the state of this monitored thread, and form the status information table of this monitored thread after receiving the response message or report message that monitored thread sends.Then, monitoring thread feeds back to system by modes such as call back function or transmission message as required with the state variation of monitored thread, according to circumstances takes different measures by system.
The master control thread of system can be known the state of each monitored thread by the mode that call back function or reception monitoring thread notification message are set, also can initiatively ask for the state of current monitored thread to monitoring thread, and take appropriate measures at different states, comprising: restart some thread, reinitialize some thread, non-distributed tasks is given some thread, reset system or trigger alarm notification user etc.
Foregoing only is an optimum implementation of the present invention, and it is not to be used for limiting the specific embodiment of the present invention, and all modification and changes of carrying out according to the main inventive concept of this method all should belong to the desired protection domain of claims of the present invention.

Claims (9)

1, realizes the method for each thread state of monitoring in real time in a kind of multi-threaded system, it is characterized in that, comprise the steps:
Step 1 is set at monitoring thread with at least one thread in the multi-threaded system, and other thread is as monitored thread, and described monitoring thread is used for regularly getting in touch with monitored thread, to know the duty of each monitored thread;
Step 2, described monitoring thread is safeguarded the information table of each monitored thread state;
Step 3, system are obtained the state of each monitored thread, and take corresponding processing mode according to the different conditions of monitored thread.
2, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that described monitoring thread is the master control thread of system.
3, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that, with a thread sole duty as monitoring thread.
4, according to realizing the method for each thread state of monitoring in real time in claim 1, the 2 or 3 described multi-threaded systems, it is characterized in that, in described step 3, the master control thread of system is known the state of each thread by the mode that call back function or reception monitoring thread notification message are set; Perhaps the master control thread of system is by initiatively asking for the state of current monitored thread to monitoring thread.
5, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that, the processing mode that system adopted comprise restart monitored thread, reinitialize monitored thread, non-distributed tasks is given monitored thread, reset system or trigger the alarm notification user.
6, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that,
In described step 1, monitoring thread regularly triggers the roll-call incident by timer is set, and sends roll-call message for all monitored threads, and the overtime length of wait acknowledge is set;
Call the roll to reply when monitored thread and take place when overtime, monitoring thread this monitored thread expired times that add up then, if this monitored thread expired times surpass the number of times of presetting, then monitoring thread should be made as ossified state by monitored thread state, and reporting system;
And in overtime length limit, call the roll the information feedback of replying and will comprise this thread work state when giving monitoring thread when monitored thread, and then entering described step 2, monitoring thread is provided with and preserves the state of this monitored thread according to replying of receiving; If at this moment monitored thread state changes, then in described step 3, monitoring thread feeds back to system with the variable condition of monitored thread, and system handles this monitored thread and expired times zero clearing that will this monitored thread.
7, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that in described step 1, monitored thread sends report message to monitoring thread when making a difference the incident of this thread state.
8, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 1, it is characterized in that in described step 1, monitored thread sends report message to monitoring thread when making a difference the incident of this thread state; Simultaneously monitored thread is monitored the roll-call message of regularly sending from monitoring thread, and after receiving roll-call message, in time the state according to self sends response message to monitoring thread, has the parameter of the state of representing this monitored thread in response message.
9, realize the method for each thread state of monitoring in real time in the multi-threaded system according to claim 8, it is characterized in that, have its state of record whether unusual zone bit takes place in the described monitored thread; Have this zone bit in the described response message.
CNB2004100098097A 2004-11-17 2004-11-17 Method for realizing real time threads state monitoring in multiple thread system Expired - Fee Related CN1295612C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100098097A CN1295612C (en) 2004-11-17 2004-11-17 Method for realizing real time threads state monitoring in multiple thread system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100098097A CN1295612C (en) 2004-11-17 2004-11-17 Method for realizing real time threads state monitoring in multiple thread system

Publications (2)

Publication Number Publication Date
CN1605987A true CN1605987A (en) 2005-04-13
CN1295612C CN1295612C (en) 2007-01-17

Family

ID=34763103

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100098097A Expired - Fee Related CN1295612C (en) 2004-11-17 2004-11-17 Method for realizing real time threads state monitoring in multiple thread system

Country Status (1)

Country Link
CN (1) CN1295612C (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100530107C (en) * 2007-03-02 2009-08-19 中国科学院声学研究所 Single process contents server device and method based on IO event notification mechanism
CN101256531B (en) * 2008-04-08 2011-04-06 中兴通讯股份有限公司 Method for analysis of built-in equipment real-time property
WO2011079585A1 (en) * 2009-12-31 2011-07-07 腾讯科技(深圳)有限公司 Method and apparatus for obtaining progress blocking information
CN102214098A (en) * 2011-06-15 2011-10-12 中山大学 Dynamic webpage data acquisition method based on WebKit browser engine
CN102222015A (en) * 2010-04-13 2011-10-19 三星电子(中国)研发中心 System and method for detecting deadlock in multithreaded program
CN101458640B (en) * 2007-12-14 2012-05-23 环达电脑(上海)有限公司 System capable of monitoring multithread state and monitoring method thereof
CN102833120A (en) * 2011-06-14 2012-12-19 中兴通讯股份有限公司 Method and system for handling exception of network management server in quick test professional (QTP)
CN102843607A (en) * 2012-07-24 2012-12-26 四川长虹电器股份有限公司 Method for monitoring process state in set top box
CN101882089B (en) * 2009-05-07 2013-05-08 中兴通讯股份有限公司 Method for processing business conversational application with multi-thread and device thereof
CN103176901A (en) * 2013-02-27 2013-06-26 深圳创维数字技术股份有限公司 Method and system for embedded software test monitoring
CN103686157A (en) * 2013-12-25 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and system for providing alarm in cloud transcoding
CN104065626A (en) * 2013-03-21 2014-09-24 杭州海康威视数字技术股份有限公司 Method for updating logging-on state of network camera and device thereof
CN104636259A (en) * 2015-03-18 2015-05-20 厦门雅迅网络股份有限公司 Function execution timeout and deadlock detection method based on dynamic tracking of operating period
CN105550028A (en) * 2015-12-25 2016-05-04 Tcl集团股份有限公司 Multi-task time sequence execution method and system based on cache locks
CN105700938A (en) * 2016-01-15 2016-06-22 浪潮通用软件有限公司 Multithread processing data method and device
CN106371976A (en) * 2016-08-31 2017-02-01 福建天晴数码有限公司 Method and system for monitoring thread by client and Web server
CN106385341A (en) * 2016-08-31 2017-02-08 福建天晴数码有限公司 Thread monitoring method and system of client
CN106708710A (en) * 2015-11-12 2017-05-24 高德软件有限公司 Thread jamming identification method and apparatus
CN107451257A (en) * 2017-07-31 2017-12-08 郑州云海信息技术有限公司 A kind of maintainable system and method based on distributed file system
CN108415806A (en) * 2018-02-07 2018-08-17 深圳市亿联智能有限公司 A kind of high efficiency thread life monitoring mode
CN112181702A (en) * 2020-09-23 2021-01-05 北京紫光展锐通信技术有限公司 Thread monitoring method and device
CN112379979A (en) * 2020-10-27 2021-02-19 航天信息股份有限公司 Thread overtime monitoring method applied to tax control service
CN114077222A (en) * 2020-08-21 2022-02-22 中国科学院沈阳自动化研究所 Equipment control system for increasing and decreasing materials alternately by multiple threads

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6378125B1 (en) * 1999-02-22 2002-04-23 International Business Machines Corporation Debugger thread identification points
GB2355319B (en) * 1999-10-14 2003-11-12 Ibm Job scheduler

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100530107C (en) * 2007-03-02 2009-08-19 中国科学院声学研究所 Single process contents server device and method based on IO event notification mechanism
CN101458640B (en) * 2007-12-14 2012-05-23 环达电脑(上海)有限公司 System capable of monitoring multithread state and monitoring method thereof
CN101256531B (en) * 2008-04-08 2011-04-06 中兴通讯股份有限公司 Method for analysis of built-in equipment real-time property
CN101882089B (en) * 2009-05-07 2013-05-08 中兴通讯股份有限公司 Method for processing business conversational application with multi-thread and device thereof
WO2011079585A1 (en) * 2009-12-31 2011-07-07 腾讯科技(深圳)有限公司 Method and apparatus for obtaining progress blocking information
CN102222015B (en) * 2010-04-13 2016-04-27 三星电子(中国)研发中心 Detect the method and system of the deadlock in multithread programs
CN102222015A (en) * 2010-04-13 2011-10-19 三星电子(中国)研发中心 System and method for detecting deadlock in multithreaded program
CN102833120A (en) * 2011-06-14 2012-12-19 中兴通讯股份有限公司 Method and system for handling exception of network management server in quick test professional (QTP)
CN102833120B (en) * 2011-06-14 2017-06-13 中兴通讯股份有限公司 The abnormal method and system of NM server are processed in a kind of rapid automatized test
CN102214098A (en) * 2011-06-15 2011-10-12 中山大学 Dynamic webpage data acquisition method based on WebKit browser engine
CN102843607A (en) * 2012-07-24 2012-12-26 四川长虹电器股份有限公司 Method for monitoring process state in set top box
CN103176901A (en) * 2013-02-27 2013-06-26 深圳创维数字技术股份有限公司 Method and system for embedded software test monitoring
CN104065626A (en) * 2013-03-21 2014-09-24 杭州海康威视数字技术股份有限公司 Method for updating logging-on state of network camera and device thereof
CN103686157B (en) * 2013-12-25 2015-10-14 乐视网信息技术(北京)股份有限公司 The method and system of warning is provided in cloud transcoding
CN103686157A (en) * 2013-12-25 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and system for providing alarm in cloud transcoding
CN104636259A (en) * 2015-03-18 2015-05-20 厦门雅迅网络股份有限公司 Function execution timeout and deadlock detection method based on dynamic tracking of operating period
CN104636259B (en) * 2015-03-18 2020-05-22 厦门雅迅网络股份有限公司 Function execution timeout and deadlock detection method based on dynamic tracking of operation period
CN106708710A (en) * 2015-11-12 2017-05-24 高德软件有限公司 Thread jamming identification method and apparatus
CN105550028A (en) * 2015-12-25 2016-05-04 Tcl集团股份有限公司 Multi-task time sequence execution method and system based on cache locks
CN105550028B (en) * 2015-12-25 2019-08-06 Tcl集团股份有限公司 A kind of multitask timing execution method and system based on buffer lock
CN105700938A (en) * 2016-01-15 2016-06-22 浪潮通用软件有限公司 Multithread processing data method and device
CN106385341A (en) * 2016-08-31 2017-02-08 福建天晴数码有限公司 Thread monitoring method and system of client
CN106371976A (en) * 2016-08-31 2017-02-01 福建天晴数码有限公司 Method and system for monitoring thread by client and Web server
CN107451257A (en) * 2017-07-31 2017-12-08 郑州云海信息技术有限公司 A kind of maintainable system and method based on distributed file system
CN108415806A (en) * 2018-02-07 2018-08-17 深圳市亿联智能有限公司 A kind of high efficiency thread life monitoring mode
CN114077222A (en) * 2020-08-21 2022-02-22 中国科学院沈阳自动化研究所 Equipment control system for increasing and decreasing materials alternately by multiple threads
CN112181702A (en) * 2020-09-23 2021-01-05 北京紫光展锐通信技术有限公司 Thread monitoring method and device
CN112379979A (en) * 2020-10-27 2021-02-19 航天信息股份有限公司 Thread overtime monitoring method applied to tax control service

Also Published As

Publication number Publication date
CN1295612C (en) 2007-01-17

Similar Documents

Publication Publication Date Title
CN1295612C (en) Method for realizing real time threads state monitoring in multiple thread system
Edrington et al. Machine monitoring system based on MTConnect technology
US6993681B2 (en) Remote administration in a distributed system
CN106649766B (en) Message processing method based on kafka
CN101236513B (en) Distributed task system and distributed task management process
CN102195825B (en) A kind of client and the complete mutual supervisory control system of server and method for supervising thereof
US20070038744A1 (en) Method, apparatus, and computer program product for enabling monitoring of a resource
US20100043004A1 (en) Method and system for computer system diagnostic scheduling using service level objectives
EP2324406B1 (en) Method and apparatus for monitoring the performance of a power delivery control system
EP2503733A1 (en) Data collecting method, data collecting apparatus and network management device
US8510755B2 (en) Automatically re-starting services
CN102523115A (en) Server monitoring system based on power environment system
CN102291275A (en) Server cluster monitoring technology and method
WO2012050224A1 (en) Computer resource control system
CN113031870A (en) Dynamic management method, device, storage medium and equipment for cluster system
CN104408110A (en) Method, device and system for requesting data
CN112395124A (en) Robot abnormity control method and device in cluster environment
CN109766198B (en) Stream processing method, device, equipment and computer readable storage medium
CN110798339A (en) Task disaster tolerance method based on distributed task scheduling framework
CN110191016B (en) Cloud platform service monitoring method, device, equipment and system and readable storage medium
US7552057B2 (en) Method and apparatus for using process exceptions to provide instant notifications for distributed processes
CN111669425B (en) Method for monitoring microservice interface and storage medium
CN113535344A (en) Network data processing method and device, server and storage medium
US11469959B2 (en) Decentralized auto-scaling of network architectures
Gaj The concept of a multi-network approach for a dynamic distribution of application relationships

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: 20070117

Termination date: 20141117

EXPY Termination of patent right or utility model