/
html/
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from ProgrammersManual.texinfo on 4 March 1997 -->

<TITLE>LambdaMOO Programmer's Manual - Checkpointing</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="ProgrammersManual_1.html">first</A>, <A HREF="ProgrammersManual_64.html">previous</A>, <A HREF="ProgrammersManual_66.html">next</A>, <A HREF="ProgrammersManual_77.html">last</A> section, <A HREF="ProgrammersManual_toc.html">table of contents</A>.
<P><HR><P>


<H3><A NAME="SEC65" HREF="ProgrammersManual_toc.html#TOC65">Checkpointing the Database</A></H3>

<P>
The server maintains the entire MOO database in main memory, not on disk.  It
is therefore necessary for it to dump the database to disk if it is to persist
beyond the lifetime of any particular server execution.  The server is careful
to dump the database just before shutting down, of course, but it is also
prudent for it to do so at regular intervals, just in case something untoward
happens.

</P>
<P>
To determine how often to make these <STRONG>checkpoints</STRONG> of the database, the
server consults the value of <CODE>#0.dump_interval</CODE>.  If it exists and its
value is an integer greater than or equal to 60, then it is taken as the number
of seconds to wait between checkpoints; otherwise, the server makes a new
checkpoint every 3600 seconds (one hour).  If the value of
<CODE>#0.dump_interval</CODE> implies that the next checkpoint should be scheduled at
a time after 3:14:07 a.m. on Tuesday, January 19, 2038, then the server instead
uses the default value of 3600 seconds in the future.

</P>
<P>
The decision about how long to wait between checkpoints is made again
immediately after each one begins.  Thus, changes to <CODE>#0.dump_interval</CODE>
will take effect after the next checkpoint happens.

</P>
<P>
Whenever the server begins to make a checkpoint, it makes the following verb
call:

</P>

<PRE>
$checkpoint_started()
</PRE>

<P>
When the checkpointing process is complete, the server makes the following verb
call:

</P>

<PRE>
$checkpoint_finished(<VAR>success</VAR>)
</PRE>

<P>
where <VAR>success</VAR> is true if and only if the checkpoint was successfully
written on the disk.  Checkpointing can fail for a number of reasons, usually
due to exhaustion of various operating system resources such as virtual memory
or disk space.  It is not an error if either of these verbs does not exist; the
corresponding call is simply skipped.

</P>
<P><HR><P>
Go to the <A HREF="ProgrammersManual_1.html">first</A>, <A HREF="ProgrammersManual_64.html">previous</A>, <A HREF="ProgrammersManual_66.html">next</A>, <A HREF="ProgrammersManual_77.html">last</A> section, <A HREF="ProgrammersManual_toc.html">table of contents</A>.
</BODY>
</HTML>