Re: Is it possible to save a running program and reload next time ?



Dennis Lee Bieber wrote:
On Thu, 21 Sep 2006 15:34:21 +0800, "fdu.xiaojf@xxxxxxxxx"
<fdu.xiaojf@xxxxxxxxx> declaimed the following in comp.lang.python:

Is it possible that the program can save all running data to a file when I want it to stop, and can reload the data and continue to run from where it stops when the computer is free ?

You'd have to write the code to save state, which means you'd have
to be at a known resumable point... I suspect that, if you're nested
into a recursive function, that will not be possible as you'd have to
recreate the calling stack along with populating all know data.

It should be pointed out that "chaos theory" sort of got its start
from an attempt at doing something similar -- saving a massive data
array for later reloading. It turns out the saved data didn't have the
full resolution of the computations, so the restart from the saved data
diverged rapidly from where the prior run had been heading. (As I
recall, it was a weather simulation in the late 60s early 70s, and the
data was saved in single-precision text format -- meaning round-off
errors on output/input; these days it would be the equivalent of the
losses inherent in doing a long computation in 80-bit IEEE, but saving
intermediates [for reload] in 64-bit IEEE).

The other option may not be available under most operating system...
Namely a snapshot of the entire "core" of memory, so you can restore the
machine /exactly/ to the state it had been at the time of the snapshot
(this would probably affect everything on the machine -- all other
programs, etc.)


Though if someone else have more information contradicting me, I'd
be happy to hear it... <G>
Thank you all!

Can objects be saved and reloaded by "Pickle" ? I have tried but no
success.

One of my friends tell me that VMware can save the current state of a
virtual machine by suspending it, and can restore the identical state
later. When a virtual machine is suspended , a file with a .vmss
extension is created(about 20M), which contains the entire state of the
virtual machine. When you resume the virtual machine, its state is
restored from the .vmss file.

So can this method be implemented with python ?

I have another idea. When python is running, it uses about 10M memory.
So can I just save a copy of the memory used by python and restore it
later ?

Regards,

xiaojf

.



Relevant Pages

  • Re: Project organization and import
    ... I don't think reload works for anything but trivial scripts. ... moment you use "from foo import bar" reload is broken. ... for why a magic reload is essential to Python development when a) all ... saying that my best option is to just "reboot" the virtual machine to ...
    (comp.lang.python)
  • Re: ISA 2000 Restore (via Virtual PC 2004)
    ... Unfortunately backups of ISA 2000 are closely tied to the original ... perform a full backup, including System State, of the original server as it ... and restore it on top of your current Virtual PC guest (the ... onto the virtual machine, which will actually look to ISA like the original ...
    (microsoft.public.isaserver)
  • Re: ISA 2000 Restore (via Virtual PC 2004)
    ... that server when deleting them.. ... > entire configuration, as per your needs. ... and restore it on top of your current Virtual PC guest (the ... > onto the virtual machine, which will actually look to ISA like the original ...
    (microsoft.public.isaserver)
  • Re: strange telnet behavior
    ... Then restore your data only. ... > You really don't have to wipe and reload to recover from this root kit. ... compromise should be to reinstall and restore from backup. ...
    (Incidents)
  • Reloading XP Pro
    ... Parts of my XP-pro is gone, namely PCHealth so restore is ... I have my CD-Roms but I can not ... Restore won't run without PCHealth directory. ... Other parts of XP also seem corrupted so I figure a reload ...
    (microsoft.public.windowsxp.general)