Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Hang (computing)

From Wikipedia, the free encyclopedia
When a process becomes non-responsive
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Hang" computing – news ·newspapers ·books ·scholar ·JSTOR
(February 2023) (Learn how and when to remove this message)

Incomputing, ahang orfreeze occurs when either aprocess or system ceases to respond toinputs. A typical example is when computer'sgraphical 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 bothclients andservers, and is not limited to graphical user interface issues.

Hangs have varied causes and symptoms, includingsoftware orhardware defects, such as aninfinite loop or long-running uninterruptible computation, resource exhaustion (thrashing), under-performing hardware (throttling), external events such as a slowcomputer network, misconfiguration, andcompatibility problems. The fundamental reason is typically resource exhaustion: resources necessary for some part of the system to run are not available, due to being in use by other processes or simply insufficient. Often the cause is an interaction of multiple factors, making "hang" a looseumbrella term rather than a technical one.

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 modernoperating systems provide the user with a means to forcibly terminate a hung program withoutrebooting orlogging 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 bypower cycling with an off/on or reset button.

A hang differs from acrash, in which the failure is immediate and unrelated to the responsiveness of inputs.[citation needed]

Multitasking

[edit]

In a multitasking operating system, it is possible for an individualprocess orthread 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 acooperative multitasking system, any thread that gets stuck without yielding will hang the system, as it willwedge itself as the running thread and prevent other threads from running.

By contrast, modern operating systems primarily usepre-emptive multitasking, such asWindows 2000 and its successors, as well asLinux andApple Inc.'smacOS. In these cases, a single thread getting stuck will not necessarily hang the system, as the operating system will preempt it when its time slice expires, allowing another thread to run. If a thread does hang, the scheduler may switch to another group of interdependent tasks so that all processes will not hang.[1] However, a stuck thread will still consume resources: at least an entry in scheduling, and if it is running (for instance, stuck in an infinite loop), it will consume processor cycles and power when it is scheduled, slowing the system though it does not hang it.

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 awindow on top of a hanging program during a hang may cause a window trail from redrawing.[2]

Causes

[edit]

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 anupgrade). 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 aloop, or, in aco-operative multitaskingoperating system, forgetting to yield to other tasks. Said differently, manysoftware-related hangs are caused bythreads waiting for an event to occur which will never occur.[4] This is also known as aninfinite loop.

Another cause of hangs is arace condition in communication betweenprocesses. One process may send asignal to a second process then stop execution until it receives a response. If the second process is busy the signal will be forced to wait until the process can get to it. However, if the second process was busy sending a signal to the first process then both processes would wait forever for the other to respond to signals and never see the other’s signal (this event is known as adeadlock). If the processes areuninterruptible they will hang and have to be shut down. If at least one of the processes is a criticalkernel process the whole system may hang and have to be restarted.

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), ormemory 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 asspyware.

Solutions

[edit]

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.

Modernoperating systems provide a mechanism for terminating hung processes, for instance, with theUnixkill command, or through a graphical means such as theTask Manager's "end task" button inWindows (select the particular process in the list and press "end task"). Older systems, such as those runningMS-DOS, early versions of Windows, orClassic Mac OS often needed to becompletely restarted in the event of a hang.

Onembedded devices where human interaction is limited, awatchdog timer canreboot the computer in the event of a hang.

See also

[edit]

Notes

[edit]
  1. ^Windows appends the text "(Not responding)" to the window title. SinceWindows Vista, the window content grays upon attempted user interaction, to make it clear that the program is not responsive.

References

[edit]
  1. ^US 6052707, D'Souza, David, "Preemptive multi-tasking with cooperative groups of tasks", published 1996-06-21, issued 2000-04-18 
  2. ^"Nostalgia: Dragging the Windows XP error dialog".Archived from the original on 2022-01-19. Retrieved2022-01-19.
  3. ^"How to Troubleshoot Computer Hangs During Hardware Detection". Microsoft Support. 2007-01-27. Archived fromthe original on 2016-03-14. Retrieved2018-04-13.
  4. ^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. Retrieved2018-04-13.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Hang_(computing)&oldid=1303865321"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp