Perhaps reading about "cost:benefit analysis" would be a good place to start.

Before I'd consider complicating a script that's supposed to be doing "real" work with the seatbelts, warning labels, failsafes, et al to deal with even the two points of failure you've mentioned, I'd want to know how likely those are and what it will cost me if they occur without additional protection.

For example, re power failure: will the code (and storage and CPU cycles) to protect against loss of power, spike, surge or whatever cost more than
    a) ...the cost of restarting the process from whatever was the state of affairs prior to the hypothetical failure? (Yes, this improperly ignores the costs incurred by whatever consequences of the outage develop because of or during the outage.)
    b) ...an UPS and backup generator?

If the s/w is doing reactor control, yeah, we probably better have failsafe s/w... but if the s/w is adjusting the "lights on" time in a hobby-farm chicken coop, maybe it's not worth the programmer time to write the failsafes.

Bottom line: I know this doesn't answer the question you asked... but -- by way of apology -- hope I've offered some thoughts worth considering before you go charging off to build the next 'unsinkable' Titanic or Fukushima Dai-Ichi.


In reply to Re: methods of recovering from ram issues by ww
in thread methods of recovering from ram issues by bigmoose

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.