摘要
针对分布式系统环境下,计算资源代理对其子进程监控的方法单一,且不能准确获取子进程运行状态的问题,提出了一种根据子进程的窗口句柄定时检测子进程运行状态的方法。该方法首先根据子进程的不同类型采用不同的方法获取子进程的窗口句柄,然后根据子进程的窗口句柄定时获取子进程的运行状态,最后将传统的等待子进程退出的方法引入到本应用中。运行结果表明,本方法可以及时准确检测出Windows环境下子进程的运行状态,并在子进程异常退出时,可以准确地获取其异常退出码。
A method based on the window handle of the subprocess real-time detecting the running state of the subprocess is presented, because the method of the computing resource agent monitoring its subprocess is single and it cannot acquire accurately the question of the running state of the subprocess under the distributed system environment. This method gets the window handle of the subprocess first according to the different types of the subproeess adopting the different ways, then gets regularly the running state of the subprocess according to the window handle of the subprocess, finally the traditional method of waiting for the subprocess to exit is introduced to the application. The running results suggest that this method can detect the running state of the subprocess under the Windows environment in time and exactly, and it can get the abnormal exit code accurately when the subprocess exits abnormally.
出处
《微型机与应用》
2013年第7期1-4,共4页
Microcomputer & Its Applications
基金
"十一五"国家科技支撑计划(2009BAG12A01-A01)