[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: killer net app
Alexander L. Belikoff writes:
>
> AFAIK, in some programming FAQ (c-faq?) the non-standard unexec()
> system call was mentioned, which allowed a process to dump it's
> context. Also, see emacs sources - emacs used to dump itself somewhow.
>
> There are many non-standard ways to acheive it. If you want to go
> portable - just write your data every NNN secs. Otherwise - try to
> create a more or less portable library of the appropriate routines,
> which would call non-standard sytem calls.
Lots of programs can dump their state & restart afterwards. Aside
from the "non-standard unexec", there're also various ways a program
can write a binary containing the program in its current state so that
when the new file is run, the program continues from where it left
off. This involves using either the dld library, the a.out header
files, and/or the standard dl* routines. Lots of interpreters have
this capability to various degrees. See the code for STk for one way
to attack the problem.
As someone else has pointed out, the basic problem one runs into is in
continuing input/output/network connections where one left off. Ones
program would have to try to re-establish these connections when
restarted, and they all involve someone else's state data (the
kernel's and/or another process, possibly running on another system,
and/or another machine's kernel).
For example, consider trying to freeze/unfreeze an X program. When
unfreezing, one would have to re-establish a connection to an X
server, and reconstruct all the windows at the point of freezing -
tricky business, and not just a Linux kernel problem.
--
Harvey J. Stein
Berger Financial Research
abel@netvision.net.il
References: