MTS 8: LISP and SLIP in MTS
Page Revised February 1979 June 1976
Examples:
(TIMER ’X 1.E6) = X
A timer interrupt is set up with the ID X for one second of CPU time.
(TIMER T 20) = T
A timer interrupt is set up with the ID T. The interrupt will occur
after 20 seconds of elapsed time.
(TIMER T NIL) = XX
The interrupt is canceled, and the remaining time is returned.
DEFUN TCOUNT (X Y) (TIMER T Y) (EVAL X)
(SUB Y (TIMER T NIL)))
Here a function TCOUNT is defined. TCOUNT takes a form X to be
evaluated, and a number Y which is the maximum time allowed to it.
TCOUNT will either generate a TIMER error, or return the time it took to
EVAL the form (plus a small amount of overhead).
The Garbage Collector _____________________
This section only briefly describes the garbage collection routine in
the LISP system. This routine is activated when a job runs out of space
needed to create new LISP structures. The garbage collector reuses
space which is occupied by unreferenced structures, allocates more space
if necessary, and notifies the user if the maximum allowable space is
exceeded.
The user may optionally receive a message at the end of each garbage
collection (see the STATUS function) indicating that the garbage
collection has occurred.
Two attention interrupts issued during garbage collection will cause
an immediate return to MTS. A restart from MTS will return to the
garbage collector and continue execution.
(CHECKPOINT A S) and (RESTORE A) __________________________________
CHECKPOINT and RESTORE allow the user to save a "snapshot" of his
current system, and restore the same system at a later time. A
checkpointed system takes up less space on disk, and requires considera-
bly less time to load than a LISP system stored in source (S-expression)
| form. In addition, checkpointing often is much less expensive than
| garbage-collecting a large program if the collection can be anticipated.
76 LISP

MTS 8: LISP and SLIP in MTS
June 1976 Page Revised February 1979
| (CHECKPOINT A) saves the current system in the MTS file A. Both
| sequential and line files are supported; however, line files are more
| efficient for storing many checkpoints.
(RESTORE A) restores the LISP system previously saved by CHECKPOINT
in MTS file A.
(CHECKPOINT A S) checkpoints only the LISP structure S. On a restore
of the file A, the system will be augmented by structure S.
Note: The arguments to CHECKPOINT and RESTORE are not IOARGs. They
are actual MTS file names. The user should not attempt to open a file
for the purpose of CHECKPOINT and RESTORE.
A call to CHECKPOINT may occur at any level of LISP. However, a
restore of the entire system always returns to the top level. ______ ______
When CHECKPOINT terminates, a message is printed on *MSINK* which
informs the user of the number of pages of memory used by his program.
In addition, (CHECKPOINT A), which destroys freespace, immediately
initiates a restore of the system which it just checkpointed. However,
if the appropriate status code is set, CHECKPOINT will not initiate a
| restore, but will terminate execution. Upon termination of a RESTORE, a
| message is printed on *MSINK* indicating what was restored and when it
| was last checkpointed.
CHECKPOINT and RESTORE are N-type functions which do not have their
arguments evaluated.
Notes:
(1) On a restore of a specific structure S, it may be the case that
an atom A occurs in the structure to be restored, and there is
already an atom A on the system OBJECT LIST. In general, the
VALUE and PLIST of the existing atom A will be modified to the
VALUE and PLIST of A at the time of the checkpoint, and this
atom will be referenced by the structure being restored. Thus,
structures which referred to A before the restore was performed
will find that the same atom has been given a new VALUE and
PLIST by RESTORE. However, the user may reverse this priority
by setting the PLIST of an atom to *UNDEF* before he performs
the checkpoint. In that case, when the restore takes place, if
there is no atom A on the OBJECT LIST, then A will be created,
and both its VALUE and PLIST will be *UNDEF*. If there is an
atom A, however, the checkpointed structure will reference it,
but its VALUE and PLIST will not be altered.
(2) After a total system checkpoint file is restored, the system
will begin reading from the current input buffer (usually
LISPIN). If the user wants some initialization performed after
a restore, he can checkpoint the initialization form into his
file by putting it on the same input line, e.g., (CHECKPOINT
MYFILE) (REINIT).
LISP 77
Previous Page Next Page