Question:
Who has a cure for system freeze and hang.?
bradbrowne
2009-05-31 20:59:12 UTC
I remember from my "BASIC" programing days that a routine does not stop running it just gets caught in a loop, until you get it out, such as an "if then".

My question is.... have todays developers gotten so far away from the basics of programing that we can no longer plug in the proper "if then" to relieve us from some misery of rebooting megabyte programs when that freeze and hang on us??.
Five answers:
Bob M
2009-05-31 22:33:23 UTC
Me M has given you a full answer I will just add something for your own information.



When your computer hangs, or appears to have crashed, it hasn't. You are on a timesliced system. A particular application or service might take up a lot of CPU time, but keystrokes will still get through.



On linux this means that you can stop such processes, this is less easy on Windows since often these services run at the level of the callier, which in this case is the system.



But eventually the timeslicing means that key strokes to stop it will get through. It is important though not to fill the keyboard buffer by pressing the keystrokes over and over. This is because each time you do that an interrupt happens, pulling even more time away from responding to your first atempt to stop an application.



So press the keys (or mouse) then sit back and wait. Once it has cleared have a look in your logs, something is behaving badly and you want to know what it is.
Me M
2009-05-31 22:03:35 UTC
I truly hope you are not basing your beliefs of what programmers do on old memories of using the BASIC programming language. Many things, not just loops, can cause computers or applications to hang or run extremely slow. Examples of this are deadlocks in multi-threaded applications, poorly written hardware drivers that cause system instability, unexpected I/O errors, damaged hardware, insufficient amounts of RAM, problems with uncaught exceptions, improper configurations or settings (usually caused by the user), locks from other programs on files or data, poor network connections, and may others. Saying that a lack of a conditional statement to break a loop is the reason programs freeze is like saying the reason a car won't work correctly is because it is out of gas. Yes, that *could* be the reason, but there are MANY more possible problems that could be much more complicated.



This most common reason computers freeze isn't because an important program is poorly written or has an infinite loop. The most common problem is the user has too many programs that are running at once and he/she doesn't even realize it. An example of this is 3rd part program add-ons that are almost worthless but use up a lot of ram and make other programs unstable because they force a program to do things it wasn't designed to do. This will likely cause a program to freeze or crash. Other examples include many of the utilities that start when your computer starts (you often see these is the system tray). All of these programs, utilities, and add-ons use memory. If your system doesn't have enough memory, it has to swap data back and forth between temporary storage on the hard drive and storage in the ram. If a program requires the data immediately and it has to wait to get data from the hard drive, it may hang.



No, programmers have not gotten away from the basics. Programs are much more complicated now than they were in the 70's and 80's, when BASIC was common. Also, computers are more common now and many people own computers without the slightest understanding of how they work. When a person that doesn't understand a computer starts to use and modify them, errors will occur.
anonymous
2009-06-01 00:01:33 UTC
A lot of people buy a new computer that runs fast at first, then months later it is running very slow. It isn't the computers fault, it is because you have not maintained it to keep running at it's peak performance level. Next you need to use a program like Perfect Optimizer to optimize your PC. You can free download here:

http://ur.lc/4p7

I especially like the 1-Button feature for fixing everything. It's very easy to use, you can fix your pc errors by only a few clicks.
TEX4S
2009-05-31 21:06:35 UTC
Wow --



OK the best way I can explain this to you is you are trying to use reasoning from 1000 years ago - to apply it to the properties of flight - well thats the equivalent...



Yes there are still if then, and loop, and arrays and subroutines, but you have to realize computers and software have gotten infinitely more complex since

10 PRINT I AM OLD;

20 GOTO 10

30 REM **THIS IS ALL I CAN REMEMBER**

35 END



RUN



If something is hanging - maybe there is a patch - a cure ?? we need to know what is sick
DrDave
2009-05-31 21:04:13 UTC
Got little to do these days with loops. Most freezes nowdays are due to overstressed processors and not enuff ram.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...