Hang (computing)
This article needs additional citations for verification. (February 2023) |
In computing, a hang or freeze occurs when either a process or system ceases to respond to inputs. A typical example is when computer's graphical user interface (such as Microsoft Windows[a]) no longer responds to the user typing on the keyboard or moving the mouse. The term covers a wide range of behaviors in both clients and servers, and is not limited to graphical user interface issues.
Hangs have varied causes and symptoms, including
A hang may be temporary if caused by a condition that resolves itself, such as slow hardware, or it may be permanent and require manual intervention, as in the case of a hardware or software logic error. Many modern operating systems provide the user with a means to forcibly terminate a hung program without rebooting or logging out; some operating systems, such as those designed for mobile devices, may even do this automatically. In more severe hangs affecting the whole system, the only solution might be to reboot the machine, usually by power cycling with an off/on or reset button.
A hang differs from a crash, in which the failure is immediate and unrelated to the responsiveness of inputs.[citation needed]
Multitasking
In a multitasking operating system, it is possible for an individual process or thread to get stuck, such as blocking on a resource or getting into an infinite loop, though the effect on the overall system varies significantly. In a cooperative multitasking system, any thread that gets stuck without yielding will hang the system, as it will wedge itself as the running thread and prevent other threads from running.
By contrast, modern operating systems primarily use
However, even with preemptive multitasking, a system can hang, and a misbehaved or malicious task can hang the system, primarily by monopolizing some other resource, such as IO or memory, even though processor time cannot be monopolized. For example, a process that blocks the file system will often hang the system.
Moving around a window on top of a hanging program during a hang may cause a window trail from redrawing.[2]
Causes
Hardware can cause a computer to hang, either because it is intermittent or because it is mismatched with other hardware in the computer[3] (this can occur when one makes an upgrade). Hardware can also become defective over time due to dirt or heat damage.
A hang can also occur due to the fact that the programmer has incorrect termination conditions for a
Another cause of hangs is a
A computer may seem to hang when in fact it is simply processing very slowly. This can be caused by too many programs running at once, not enough memory (RAM), or memory fragmentation, slow hardware access (especially to remote devices), slow system APIs, etc. It can also be caused by hidden programs which were installed surreptitiously, such as spyware.
Solutions
In many cases programs may appear to be hung, but are making slow progress, and waiting a few minutes will allow the task to complete.
Modern
On embedded devices where human interaction is limited, a watchdog timer can reboot the computer in the event of a hang.
Notes
- ^ Windows appends the text "(Not responding)" to the window title. Since Windows Vista, the window content grays upon attempted user interaction, to make it clear that the program is not responsive.
See also
- Abort (computing)
- Blue screen of death
- Crash (computing)
- Deadlock
- Livelock
- Software bug
- Infinite loop
- Uninterruptible sleep
References
- ^ US 6052707, D'Souza, David, "Preemptive multi-tasking with cooperative groups of tasks", published 1996-06-21, issued 2000-04-18
- ^ "Nostalgia: Dragging the Windows XP error dialog". Archived from the original on 2022-01-19. Retrieved 2022-01-19.
- ^ "How to Troubleshoot Computer Hangs During Hardware Detection". Microsoft Support. 2007-01-27. Archived from the original on 2016-03-14. Retrieved 2018-04-13.
- ^ Calvin Hsia (2006-11-15). "Here's an infinite loop that will hang your machine". Microsoft Blogs. Archived from the original on 2018-04-14. Retrieved 2018-04-13.