2

I find myself getting confused with these two terms. I had originally thought that when a program "crashes", it automatically quits and the process is killed. But when the program stops responding, it gives that error that says "Program not responding", then prompts you as to what you would like to do next.

Is there a term that describes the "program stops responding"? Or is that term just the word "crash"? Is there a difference between the two, crash, and program stops responding?

0

2 Answers 2

5

There is.

Programs can be written using a technique called exceptions. Here's a simplified description of how they work:

  • The idea is that you can tell a part of a program, when it comes across an error or something it can't deal with, to throw an exception.
  • Another part of the program will have been previously setup to catch exceptions - this is the exception handler.
  • If the error is something that even the exception handler can't deal with it, it can do one of two things:
    • Throw it to another exception handler that might be able to handle it.
    • Just throw it "out there" to anything - if there is no exception handler willing/available to take it, the operating system itself catches it and you see the crash dialog.

So when a program crashes, it has literally given up and terminated execution.

This is different when a program stops responding. Windows programs maintain communication with the OS using a message loop. If the program gets stuck, either waiting on I/O or an infinite loop, it will stop getting messages from the loop, and Windows then tells you the program is not responding. One thing that can cause programs to unexpectedly wait on I/O is when you are low on RAM and the OS has to use the page file to handle memory requests. Another might be if your disk suddenly fails and the programmer never considered the possibility that writes to a file might be interrupted with something like that - or the programmer did something like "if this operation fails, retry forever."

So in this case, the program is still running, it's just not talking to Windows any more.

1
  • 1
    With regards to Windows specifically. With the introduction of Windows XP gained the ability to handle the state which it considers a program has stopped responding. Before Windows XP most of the time a program normally would bring the entire system down. Over the years more and more elements of Windows has gained this ability, for instance, a display driver ( which is more or less an application ) now no longer crashes the entire system most of the time. Most operating systems have gained this ability or similar features over the years.
    – Ramhound
    Nov 14, 2014 at 0:31
2

Unresponsive means literally what it says - the program is not accepting/responding to user input. It could be doing nothing or the CPU could be maxed out, it could be performing no I/O or it could be reading/writing data from/to files or sending network packets as fast as it can. It may be doing exactly what it was designed to do. The only thing it is certainly not doing is responding to user input in a timely fashion.

When a program crashes, something unexpected has happened which the program itself is not equipped to handle; when the operating system detects such an event, it (usually) terminates the program.

In Windows, an application can become unresponsive for a variety of reasons, including coding errors and poor design that fails to keep a UI loop running while it performs some long running operation. Windows tells you when an application has become unresponsive because it might be due to a coding error; Windows won't automatically terminate an application in such a state because it may simply be due to a poorly implemented long-running task.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .