Windows – create/save a hibernation state to recover from *without* actually hibernating

hibernatepowersleepwindowswindows 7

I'd like to be able to have my computer resume to it's last state (open programs etc) in the event of a forced or unintended power-off without having to actually hibernate or hybrid-sleep my machine.

Is this possible? Windows boots off of the hibernation data that is created when one hibernates or hybrid-sleeps but is it possible to manually create/update this hibernation data within windows?

Is there a third-party program that can accomplish something similar? (excluding virtual machines) I don't need an exact state save, but at the very least a method for remembering what was open and opening them again.

As it stands now, I sleep the system (hybrid sleep) after 1 hour of inactivity so in the event of a power loss, it can boot off of the hybrid-sleep state data. This is fine but it prevents me from being able to have anything running 24/7 without having to deal with occasional power losses. (which seem to happen a lot more frequently than they should)

Best Answer

There are at least two reasons why you can't do it.

First one. Hibernation works thanks to ACPI power states. It's not that simple as "dump RAM to hard drive and shutdown". RAM isn't everything, there are also devices that need to be reverted into their previous state. That's where ACPI joins the party - it lets you suspend devices when entering S5 state and resume them when returning to S0. But S5 implies shutdown, so you can't hibernate computer without shutting it down.

Second one. Let's assume we have some hardware that would allow to hibernate a running computer while keeping it on. This creates a problem similar to those that you could face when dealing with parallel computing.

Computers work sequentially. They execute series of simple (really simple, like "increase that number by 4") instructions, one by one. Modern PCs have multicore CPUs and could theoretically process multiple instructions at once, but it's not always possible. For example let's say we have three instructions.

  1. Read X from user.
  2. Multiply X by 2.
  3. Increment X by 7.

Step 2 can't be processed until step 1 is finished, because X is unknown at that time. Similiarly, step 3 can't be processed until step 2 is finished, because value of X is very likely to change in step 2. These steps must be processed one by one.

Now let's imagine we have a computer that processes bank transfers. You have some amount of money on your bank account and you want to transfer $100 to your friend's account. The algorithm looks like this and has to be processed step by step for some reason:

  1. Decrement the amount associated with your account by $100.
  2. Increment the amount on your friend's account by $100.
  3. Transfer has been processed, so remove it from the transfer queue.

Computer starts to process this transfer and suddenly, between steps 1 and 2 it turns off due to a power outage.

Now, if the computer wasn't "hibernated but alive", it will start to boot and realize that something went wrong - it will know that it should verify all recent operations. Everything is fine.

But if it was "hibernated but alive" before it started to process step 1, there's a problem - the computer doesn't know something went wrong, because it remembers everything was fine when it was being hibernated. But the data on hard drive has been updated and $100 is already withdrawn from your account, but not transferred to your friend's account yet. But computer doesn't know about that, because it happend after hibernating it.

The computer will take another $100 from your account and transfer it to your friend. The first $100 is gone.

There are hundreds of thousands of problems like that that could arise prom "hibernating" a running system.

Related Question