On Jun 17, 4:17 am, "Chris Burrows" <cfbsoftw...@[EMAIL PROTECTED]
> wrote:
> "Peter Brooks" <Peter.H.M.Bro...@[EMAIL PROTECTED]
> wrote in message
>
> news:1182026035.043466.225690@[EMAIL PROTECTED]
>
> >I imagine that this is probably platform dependent. What I'd like to
> > do, though, is to run a program and save its state, so that, when it
> > is run again, it starts where it left off, even if the machine has
> > been re-booted between times.
>
> If you can narrow down the scope of your question then there may be a
> feasible answer. For example:
>
> How much of the program's 'state' do you *need* (not necessarily *want*)
to
> save?
>
> Do you have one particular application in mind or are you looking for a
> general solution?
>
> What real-world situations are you attempting to accommodate?
>
> Are the reboots manually instigated or can they be as a result of a
power
> cut or other unexpected failure?
>
> Your question did remind me of a development system I used in the 1980's
> that had an ingenious way of providing protection against tem****ary
power
> outages without requiring a full backup power system. It was a multiuser
NCR
> Tower running Unix. A rechargeable battery was used to maintain the
total
> system state (memory contents, CPU registers, PC address etc.) in
suspended
> animation so that when full power was restored all users were able to
> continue exactly where they left off as if nothing had happened.
>
This used to be true of old core memory systems - if the power failed
and came back they simply carried on where they were before.
Actually the first poster is correct, it's the data.
What I'd like to do is, essentially, swap a program file out into
normal file space, rather than swap space, so that I can re-run it
with all it's data intact.
The reason is connected to my other question here. If you load lots of
UML or OWL data using XML's DOM model, it takes quite a while to load
and fills a fair amount of system memory. To speed things up, it would
be good to have two stages, first run the program to read in and
initialise its state from a bit XML file, then, after that, simply
swap it in from file space ready loaded.
I know that this could be done with the data contained in a pascal
'const' record, or set of records, at compile time, and that might be
the final solution, but, to my mind, that's a bit messy. I might do it
that way, if I can't find a better solution - you'd run an
'initialise' program that would write source code including the XML
file that you need included, then compile that, which would be the
program that you would run. Fast and small as the fpc compiler is,
though, if I'm going to be having hundreds, or thousands, of such
programs, it'll be something of an overhead - it would be nicer to
have the programs initialise themselves.
I know that this would be an easier job using python or php, but
that's the point, I want to avoid repeated interpretive effort to get
a good response time, recompiling repeatedly would, on balance, leave
me back in the same sort of world as java, python or php.


|