WXforum.net
May 22, 2013, 01:04:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6617  •  Posts: 178562  •  Topics: 18123
Please welcome TheMOX, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Hanger.exe Not Hanging  (Read 2113 times)
0 Members and 1 Guest are viewing this topic.
Bushman
Forecaster
*****
Offline Offline

Posts: 3492


WWW
« on: January 23, 2009, 10:55:52 AM »

I'm futzing around with virtual ports and DL'ed Hanger.exe to simulate a hung app.  However,  hanging and hogging do not go over over 50% CPU usage.  Any ideas why?
Logged
Bushman
Forecaster
*****
Offline Offline

Posts: 3492


WWW
« Reply #1 on: January 26, 2009, 02:00:59 PM »

The latest version now hogs like there is no tomorrow.  Smile  However, hanging is still not  taking much in the way of resources.  Only  about 12% on my Dell desktop.
Logged
tinplate
Moderator
Forecaster
*****
Offline Offline

Posts: 368


WWW
« Reply #2 on: January 26, 2009, 03:51:05 PM »

I'm not sure I understand. It hogs like no tomorrow but only uses 12%? When you say resources, do you mean memory?
Logged
Bushman
Forecaster
*****
Offline Offline

Posts: 3492


WWW
« Reply #3 on: January 26, 2009, 04:29:15 PM »

When I try to hang the system (top button on Hanger) with some CPU response only 11-13% of the CPU is tied up (via Task manager).  Hang with no CPU (middel button) the CPU usage is close to zero when it is asleep.  When Hanger "hogs", it take 100% of the CPU.
Logged
tinplate
Moderator
Forecaster
*****
Offline Offline

Posts: 368


WWW
« Reply #4 on: January 26, 2009, 04:52:53 PM »

There are two common states in which a program can hang. One is where it completely hangs up - it doesn't respond to any messages and it uses zero cpu - the process is there, but the program is completely dead.

Another state is one where the program is consuming some cpu, i.e. showing some sign of life, but it refuses to respond to any messages.

In the first case, it's pretty obvious the program is hung, and StartWatch only needs to see a program in that state for a short time before making the determination that it is indeed hung. The second case is more tricky. Ideally, program should be written in a way that they always respond to messages, even when they are busy doing something. In reality, many programs do not. It's not uncommon for programs to get busy and ignore message processing for a while. They're not supposed to, but they do. Here, StartWatch has to tread a fine line between identifying truly a truly hung vs. falsely identifying a busy program as hung and terminating it when it shouldn't. StartWatch does this by marking when a program is possibly hung, and then watching it a while to see if it just keeps ignoring messages. The amount of time it watches is controlled by the sensitivity slider. If you have a program that goes into the "I'm busy and ignoring the world while I work", you can set the sensitivity lower so StartWatch is more forgiving.

So those two buttons don't have anything to do with consuming all the CPU. They test these two states of hungness.
Logged
Bushman
Forecaster
*****
Offline Offline

Posts: 3492


WWW
« Reply #5 on: January 26, 2009, 05:40:53 PM »

Thanks for the explanation!  I was really just interested in the progarm to test when (if?) Weatherlink stops responding.  I can do it quite easily with Autohotkey but if I was running  other weather SW, I'd sure buy Startwatch.  Nicely done pgm.!  Smile

BTW, have you considered  enhancing it to check window titels?  most display "Not responding" or some such thing.  Startwatch with some macros based on widows title/data would be killer.
Logged
tinplate
Moderator
Forecaster
*****
Offline Offline

Posts: 368


WWW
« Reply #6 on: January 26, 2009, 06:02:59 PM »

Windows defines a do-nothing message you can send to an application. This is how StartWatch checks if a program is responsive. I'm sure the Windows code that puts the "Not Responding" text is checking the same thing, so I'm not sure that would tell StartWatch something it doesn't already know.

One of the things many people don't realize is that even though you see only one window for a program, there are often (most of the time, to be honest) several open windows associated with a program. Sometimes there are a whole bunch. These other windows just aren't seen. Sometimes you don't see them because they have their visible flag set to false. Sometimes it's because they have a size of zero pixels (but have visibility = true). Sometimes they have size and are visible but have their positions set way to the left in negative coordinate space. Programmers do all sorts of weird things like that. A drawback of Windows is that there is no direct way to find out which one is "THE" window that represents the program's main window. It's not uncommon for the application's true main window to be one of the hidden ones. Sorting through all that is a mess, and was one of the more time consuming parts of making StartWatch. Non-programmers would never guess there's all that weird stuff going on unseen. Virtual Weather Station was particularly troublesome in this respect as it uses a very unusual windowing model. It's not the author's direct fault. Much of the hidden magic windows are a side effect of the programming tool used to create Virtual Weather Station.
Logged
tinplate
Moderator
Forecaster
*****
Offline Offline

Posts: 368


WWW
« Reply #7 on: January 26, 2009, 06:12:24 PM »

Something I'll be adding very soon to StartWatch that came out of a recent feature request is the ability to configure keypresses to be sent to the program at startup (typically used to put the program in some desired state). This is sort of like the feature that's in StartWatch now to put WeatherLink in bulletin mode, but it will be done in a generic way that can be used for any program.
Logged
Bushman
Forecaster
*****
Offline Offline

Posts: 3492


WWW
« Reply #8 on: January 26, 2009, 06:18:59 PM »

Kewl!  that is what I do with Autohotkey now.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.102 seconds with 20 queries.
anything