4 ms·
To say that either (1) or (2) is always the right choice is unreasonable. It depends on context. If a program is running under a supervisor, it makes sense to
by karmakaze 8y ago
To say that either (1) or (2) is always the right choice is unreasonable. It depends on context.
If a program is running under a supervisor, it makes sense to bail, as a new clean instance will become available.
If it was the code of the life support machine that displays data on the LEDs that I was connected to, I prefer that it solder on rather than stop functioning altogether because data for one of the digits was out of 0-9 range.
I'm sure there's been many instances where spacecraft had partially malfunctioning software that was remotely corrected because it didn't entirely give up but rather continued to accept input.
- WalterBright 8y agoAircraft and spacecraft all have backup systems for critical software. When software self detects a bug (such as an assert failure) the offending computer is shut down and electrically isolated, and the backup is engaged. What is absolutely NOT done is soldiering on with a computer in an unknown state. Any software system that is life critical is either designed this way or is very badly engineered. I've written a couple articles about this: https://www.digitalmars.com/articles/b39.html https://www.digitalmars.com/articles/b39.html https://www.digitalmars.com/articles/b40.html https://www.digitalmars.com/articles/b40.html
- karmakaze 8y agoAnd what if the program is the lowest level and getting into an impossible state due to a hardware issue (bad bit). At some level a program has to soldier-on.
- WalterBright 8y agoThen it sets an I/O pin that pulls the reset switch.
- karmakaze 8y agoI cant tell ic you're being serious. The appropriateness of that would depend on whether the hardware condition was persistent in which case we have a reboot loop. It doesn't seem resonable for software meant to run in a harsh envirinment to assume prefect rumtime conditions. Do probabilitites and tradeoffs ever get considered when faced with inconsistent state?