Chapter 23. MDL as a System Process
This chapter treats MDL considered as executing in an operating-system process, and interactions between MDL and other operating-system processes. See also section 21.8.13.
TIME takes any number of arguments, which are evaluated but
ignored, and returns a
FLOAT giving the number of seconds of CPU
time the MDL process has used so far.
TIME is often used in
machine-level debugging to examine the values of its arguments, by
having MDL's superior process (say, DDT) plant a breakpoint in the
STRING which is the "user name" of MDL's process. This is
the "uname" process-control variable in the ITS version and the
logged-in directory in the Tenex and Tops-20 versions.
STRING which is the "intended user name" of MDL's
process. This is the "xuname" process-control variable in the ITS
version and identical to
<UNAME> in the Tenex and Tops-20 versions.
STRING which is the "job name" of MDL's process. This is
the "jname" process-control variable in the ITS version and the
SETNM name in the Tenex and Tops-20 versions. The characters belong
to the "sixbit" or "printing" subset of ASCII, namely those between
<ASCII *40*> and
<ASCII *137*> inclusive.
STRING which is the "intended job name" of MDL's process.
This is the "xjname" process-control variable in the ITS version and
<JNAME> in the Tenex and Tops-20 versions.
attempts to log out the process in which it is executed. It will
succeed only if the MDL is the top-level process, that is, it is
running disowned or as a daemon. If it succeeds, it of course never
returns. If it does not, it returns
causes MDL to stop running, in an orderly manner. In the ITS version,
it is equivalent to a
.LOGOUT 1 instruction. In the Tenex and
Tops-20 versions, it is equivalent to a control-C signal, and control
passes to the superior process.
("value return") seldom returns. It passes control back up the
process tree to the superior of MDL, passing its argument as a
message to that superior. If it does return, the value is
(). If the argument is a
STRING, it is passed to the superior as a
command to be executed, via
.VALUE in the ITS version and
in the Tops-20 version. If the argument is a
FIX, it is passed to
the superior as the "effective address" of a
.BREAK 16, instruction
in the ITS version and ignored in other versions.
23.4. Inter-process Communication
All of the
SUBRs in this section are available only in the ITS
The IPC ("inter-process communication") device is treated as an I/O
device by ITS but not explicitly so by MDL: that is, it is never
OPENed. It allows MDL to communicate with other ITS processes by
means of sending and receiving messages. A process identifies itself
as sender or recipient of a message with an ordered pair of "sixbit"
STRINGs, which are often but not always
message has a "body" and a "type".
23.4.1. SEND and SEND-WAIT
<SEND othern1 othern2 body type mynamel myname2> <SEND-WAIT othern1 othern2 body type mynamel myname2>
both send an IPC message to any job that is listening for it as
othern1 othern2. body must be either a
STRING, or a
of objects of
WORD. type is an optional
default, which is part of the information the other guy receives. The
last two arguments are from whom the message is to be sent. These are
<JNAME> respectively are used by
SEND returns a
FALSE if no one is listening, while
SEND-WAIT hangs until someone wants it. Both return
T if someone
accepts the message.
23.4.2. The "IPC" Interrupt
When your MDL process receives an IPC message,
(chapter 21). A handler is called with either four or six arguments
gleaned from the message. body, type, othern1, and othern2
are supplied only if they are not this process's
There is a built-in
HANDLER for the
"IPC" interrupt, with a
0 in the
PROCESS slot. The
handler prints out on the terminal the body, whom it is from, the
type if not
0, and whom it is to if not
the type is
1 and the body is a
STRING, then, after the
message information is printed out, the
<IPC-OFF> stops all listening on the IPC device.
<IPC-ON myname1 myname2>
causes listening on the IPC device as myname1 myname2. If no
arguments are provided, listening is on
<JNAME>. When a
MDL is initially listening as
<JNAME> with the built-in
HANDLER set up on the
"IPC" interrupt with a priority of
signals to ITS (directly, not via the IPC device) that the daemon
named by its argument should run now. It returns
T if the daemon
#FALSE () otherwise.