Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Most useless function.

by Moriarty (Abbot)
on Feb 17, 2006 at 01:53 UTC ( #530839=note: print w/ replies, xml ) Need Help??


in reply to Most useless function.

I have heard that ispoweron() isn't all that useless. It's used by some systems to unmount filesystems, park drive heads and other useful stuff before the capacitors are drained after the power has been turned off.


Comment on Re: Most useless function.
Re^2: Most useless function.
by jdporter (Canon) on Feb 17, 2006 at 14:48 UTC

    I really, really hope that story is apocryphal and wrong.
    What, you're going to poll that status until it goes false?
    Things like this should be event driven.

    We're building the house of the future together.
      AFAIK, there's also a signal that gets sent in event of a power fluctuation. From there, you can use "ispoweron()" to tell the difference between a momentary power blip, and a real outage condition.

      You'll only bother to poll when you've got a signal that said there was a potential outage issue, and then only to check to see if the situation has resolved itself (power back on or not). Depending on that knowledge, you can implement a variety of recovery policies (shutdown immediately; wait 10 minutes, then shutdown if the power is still out; etc).

      From what I remember, it's not a useless function; albeit rarely very useful, either. AFAIK, it's been implemented on one of the BSD varients (BSDI Unix, perhaps?)

      --
      Ytrew

        Usually there is a non-maskable interrupt from a UPS that alerts the system to shut itself down while auxiliary power is working. Much would depend on the capacity of the UPS. Ideally you'll have time to flush buffers, close files, and clean up before the power dies completely.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://530839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-07-25 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls