| [reply] |
| [reply] |
What does Windows itself use to determine when it decides an application is "Not Responding"?
| [reply] |
This is educated conjecture...
Windows sends a message to the application; if the application takes N seconds without (a) responding to that message, or (b) receiving the message and letting it die, then it considers it "hung." You can easily write small applications which do this, just by doing something as benign as a sleep for 100 seconds.
It could be smarter, and there are other issues with multiple-threaded applications: are all threads in a WaitForObject state at the same time (deadlock)? Has it handled ANY messages, not just the one test message?
-- [ e d @ h a l l e y . c c ]
| [reply] |
| [reply] |
If the process is a windows "service" then you should try to use the mechanism windows has within that API. The windows service API has an "INTERROGATE" request(or message) that is sent to the service, and as halley said it must respond within a certain amount of time - else be considered hung/unresponsive. You can perform this check using the Win32::Service 's "GetStatus" method, or another likely option is with WMI (using Win32::OLE)
If its not a windows service I don't know what to suggest. I've seen utilities output the status of threads (e.g. "waiting") - I wonder if that type of information would be useful for determining if a process is hung. Not that I can suggest how to tap that info from perl. | [reply] |
You could try calling IsHungWindowApp() if you are monitoring a specific application (and can obtain the window handle for it).
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
| [reply] |
Under XP
tasklist /FI "STATUS eq NOT RESPONDING"
| [reply] [d/l] |