Eli5 why does a program/app “hang up” and fail to load, but trying again makes it happen?

536 views

Eli5 why does a program/app “hang up” and fail to load, but trying again makes it happen?

In: Technology

4 Answers

Anonymous 0 Comments

That can have a plethora of reasons.

For example an app may need access to some online service in order to load data. If that service is unavailable or some error occured during the connection process then this app may end up in a state that it can’t recover from.

Usually software developers try to prevent the program from ensing up in such states but some things may go untested or may have been untestable with the environment the developer had to work with.

Restarting the app gets it out of this state and then the aop can receive a proper response from the online service.

One example from a recent project I worked on: I had to address several devices by doing a search over the entire possible address space of these devices. Each time the program would send out the question “are there any lights below address X?” And all devices either answered “yes” or didn’t answer if their address was higher (or if they didn’t participate in the process).

Now the problem here is, if one device is not fully functional at one point and gets out of sync with the others then this “yes” may end up corrupting the signal for all other “yes” responses as they all answer simultaneously. Now if this device corrupts the signal within the search process then the program can end up writing addresses to non-existent devices and end up taking longer (or theoretically infinite) to end the search process.

Restarting can make them sync up again and thus fixes the problem at hand.

Some of these “edge cases” simply can’t be tested well enough within a small environment. For example if you only have 3 devices to test, then you can’t necessarily encounter edge cases that exist with hundreds of devices. Your app works fine in your environment but only because you didn’t test for such edge cases.

You are viewing 1 out of 4 answers, click here to view all answers.