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.
- Read X from user.
- Multiply X by 2.
- 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:
- Decrement the amount associated with your account by $100.
- Increment the amount on your friend's account by $100.
- 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.
3Without using a virtual machine (which can take a snapshot of an entire machine - software and hardware simultaneously) or a layer to abstract any hardware changes (e.g. a hypervisor), this is just impossible. This subverts the normal workings of any modern operating system... As a crude but notable example, consider what would happen if you modified certain files on your hard drive, then resumed a previous execution state (itself assuming the filesystem was unchanged, as most operating system drivers take sole access of it upon launch). – Breakthrough – 2013-06-13T18:58:45.973
**TL,DR: Without a hypervisor/virtual machine, no.** This is why we use either technology in the first place. – Breakthrough – 2013-06-13T18:59:55.443
@Breakthrough - It is not the sole reason. There are obvious energy consumption/multitasking gains but I see your point. Why however is hibernation data kept on a disk after having woken up if it can serve no further purpose? New hibernation data must be created each time. – Enigma – 2013-06-13T19:12:58.353
3The data isn't deleted so the space it reserved won't be taken by other apps. Deleting (really resetting the bit) of the file would be redundant since it will be rewritten on the next hibernation anyway. – Martheen Cahya Paulo – 2013-06-15T08:54:34.070
1A hardware supported solution would be installing a UPS that can signal the PC on power loss, then initiate hibernate. And a RTC alarm or network wake up that will power up the system when power returned – Martheen Cahya Paulo – 2013-06-15T08:57:53.977