what would it take to make Windows programs capable of hibernation?

suppose we want to be able to hibernate a single running process rather than the entire Windows OS. I have seen claims online that in the general case this is impossible, which is why it is not supported by the OS.

Ok, so how about we wanted to find some “specific case” which would be, hopefully, as broad as possible. Or maybe we could start with a fairly narrow specific case, like how do we get Minesweeper or similar trivial apps that don’t interact with anything to hibernate.

Suppose we are writing these apps from scratch and so can impose upon the development process any needed limitations (let’s say, don’t access files directly but rather access them via some special framework that spins twice and knocks Dorothy’s magic shoes when doing that).

Suppose further that we only care about “managed” apps, let’s say .net, so that whatever wizardry needed with the memory could be more credibly implemented. If garbage collector can keep track of all the memory, maybe the hibernator can too.

Well, so what sort of restrictions would we need to impose, functionality to prohibit and rituals to establish to make a hibernatable process? Or are there some very profound aspects to the way Windows executes even managed code processes that make this 1st law of thermo type of impossible proposition?

Incidentally, if somebody out there completely did not understand what the question is about but wishes to battle the teeming millions’ ignorance of existence of the persistence framework called Hibernate, the somebody should avoid doing so in this here thread :slight_smile:

It’s possible if the OS and program are written to support it. There may have to be some re-allocation/re-initialization of some resources, but this could be minimized.

Emulators and virtual machines already do this by dumping current state of the RAM to disk and reloading it upon request.

In day to day usage, though, how would this be better than a “pause” function or simply saving, closing the program and restarting it later? Antivirus programs, compression programs, etc. can already pause their heavy-duty tasks if you ask them; the other resources they consume just to keep their UI open is insignificant for modern computers.

Also, it’s not just applications that consume power, but WiFi, the display backlight, hard drive activity, etc. Hibernating just one application isn’t going to affect all that much unless that one application is constantly doing intensive work, in which case a pause function would do pretty much the same thing.

Reply, I don’t know how it would be “better”. They say Excel is Turing complete, even though what “good” is it for us to know that? I guess such discussions deepen our understanding of the mechanics of OS, or of Excel. Or maybe there are potential uses of process hibernation that are not yet discovered, that if found could lead to an effort to implement it.

E.g. if we know how to resurrect a hibernated process, maybe next step will be to modify its internal state and then resurrect it, as some specialized testing/debugging measure. Would that be in any way better than trying to achieve the same thing by invading the memory space of a still running process and changing that? Or would both approaches be equivalent in both complexity of achieving and results yielded? Or are there other weird and wonderful things to be found by exploring this particular bit of technological terra incognita? Is the answer 42?

And yeah, I don’t expect, the Turing completeness of Excel is not likely to get traction any time soon :slight_smile: . The same applies to Turing complete - behaving patterns in http://en.wikipedia.org/wiki/Conway’s_Game_of_Life . Weird stuff, that last one.

oops, my bad. Turing completeness of Excel is indeed of practical importance because it shows that Excel spreadsheets can degenerate into http://en.wikipedia.org/wiki/Turing_tarpit or into the http://en.wikipedia.org/wiki/Halting_problem . So it serves more as an important warning that we should hid rather than as a call to action. And warnings are important in themselves.

Meanwhile the Game of Life still to me seems utterly useless :slight_smile:

Oh, if the question was meant to be academic… carry on :slight_smile:

As for editing the memory state, some emulators do that too (I’m thinking specifically of gamers cheating by hex editing saved game states, but you can probably extrapolate that to other things). I imagine you could do the same thing by running a standard program inside a virtual machine session, saving the state of that session, and analyzing it. Or you could modify your own program to save its own state.

I dunno what Turing-completeness is, so I won’t say anything about that.

Saving and reloading is what hibernating is. You save the entire contents of the RAM to disk and shut off. You restart, and, if there is a save file, you load that. I’d say the Spider Solitaire that comes with Windows hibernates.

Also, it’s pretty much what applications do on Google’s Android OS, assuming they are designed correctly. The OS can kill a background app at any time to make more room in memory for the current app. Every app is supposed to be able to be restarted and pick up exactly where it left off.