8

I came across the term "power-fail interrupt" on Wikipedia here.

Since power-failure occurs instantly, what is the use of this interrupt? By the time the computer realizes it has encountered a power-failure, it'll be switched off! What's the point of it? Also, this interrupt is given the highest priority.

Have I misunderstood the term "power-fail"?

4
  • 2
    Batteries. Or more commonly used in embedded systems - capacitors.
    – slebetman
    Sep 20, 2014 at 7:42
  • @slebetman are you defining the term "power-fail"?
    – nj-ath
    Sep 20, 2014 at 7:43
  • 3
    Power fail means that the mains power has failed. Don't think laptops. Think servers with UPS.
    – slebetman
    Sep 20, 2014 at 7:44
  • 7
    On a lot of embedded systems such as sim cards (yes, sim cards are computers) the hardware needs to save data when power is removed. Saving data takes 1/100 or a second. A small capacitor can still provide enough power to the CPU for 1/10 of a second after power failure. That's plenty of time to shut down gracefully.
    – slebetman
    Sep 20, 2014 at 7:48

1 Answer 1

7

After a power failure, the computer can remain on life support using reserve power (such as a battery).

The article you quote talks specifically about the VAX architecture. The way the power-fail interrupt works there is as follows:

Once a power-failure interrupt has been posted, the processor has approximately 4 milliseconds before power is shut down.

Thus the interrupt handler has four milliseconds to do its thing.

2
  • 3
    Note that while the term in the article refers to VAXen, power fail interrupts are still with us on server hardware - it's what UPS systems use to signal that the OS should start shutting down.
    – slebetman
    Sep 20, 2014 at 7:49
  • 4
    On old UPSes that communicate via serial port it really was a hardware interrupt via the CTS pin. On more modern USB equipped UPSes it's a virtual software interrupt via the USB bus.
    – slebetman
    Sep 20, 2014 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.