What is a program hang in comparison?


Let's say you write a tiny C program that simply loops forever, as this program does.

Example 2-1 loop.c
 main ()    {     while (1)      {     }    } 

This program will run, happily circling in a while loop, until interrupted by the user or terminated via the UNIX kill command.

Now, convert the loop program into a subroutine or function. Write thousands of lines of complex application code and have the new code jump into the little loop subroutine at noon on Thursdays.

You've now created a program that will hang at noon on Thursdays. The application will have to be kill' ed. Normal execution is now impossible because you are stuck in that simple little loop.

While the application is hung up in a loop, the rest of the users on the system are doing just fine. A hung program doesn't affect the rest of the system unless it happens to be eating a disk or two or other kernel resources in the process. So, it is very important to remember that if one user calls you and reports that the system is hung, it may not be true. Dig a bit deeper before you force a system panic!



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net