Go to the first, previous, next, last section, table of contents.

Class Job

Each Class Job instance contains information about one Muq thread of control: It tracks a program counter pointing into some executable, with an associated stack of return information.

Jobs are Muq's closest approximation to the unix concept of a process, but are more like threads because all Muq jobs (in a given server) share a single address space and database, hence may freely exchange not just strings and numbers, but data values of any sort whatever, including objects, stacks and jobs.

Muq jobs run round-robin under pre-emptive multi-tasking, normally blocking when they read from an empty message stream or write to a full message stream.

Muq jobs support a fairly complete unix-like set of signals which may be blocked, ignored, provided with handlers, and so forth.

Class Job adds the following properties to those of Class Plain:

$S.debugIo:        Bidirectional messageStream for debugging I/O.
$S.doBreak:        Function to call when 'break' is executed.
$S.debugger_hook:   Runs before $s.debugger'.
$S.debugger:        Interactive event handler.
$S.compiler:        Compiler instance currently in use by the running shell.
$S.spareAssembler: Used internally by compilers.
$S.spareCompileMessageStream: Reserved for compiling code from strings.
$S.breakDisable:   non-NIL turns 'break' and ']break' into no-ops.
$S.breakEnable:    non-NIL lets ]error and ]cerror enter debugger.
$S.breakOnSignal: T runs ]invokeDebugger on every signal.
$S.doingPromiscuousRead: NIL except during |readAnyStreamPacket.
$S.promiscuousNoFragments: Internal state during |readAnyStreamPacket.
$S.doError:        Fn invoked when server detects an error.
$S.doSignal:       Fn invoked by 'signal' to do most of the work.
$S.errorOutput:    Message-stream for standard error output.
$S.queryIo:        Bidirectional Message stream for query I/O.
$S.ephemeral-lists:   Loop stack offset of most recent ephemeral list.
$S.ephemeralObjects: Loop stack offset of most recent ephemeral object.
$S.ephemeralStructs: Loop stack offset of most recent ephemeral struct.
$S.ephemeralVectors: Loop stack offset of most recent ephemeral vector.
$S.functionBindings: Loop stack offset of most recent function binding.
$S.variableBindings: Loop stack offset of most recent variable binding.
$S.muqnetIo:       Dedicated stream for transparent networking support.
$S.standardInput$s.twin:  Job reads vals written to this message stream.
$S.standardOutput: Job output is written to this messageStream.
$S.terminalIo:     Bidirectional message stream for human I.O.
$S.traceOutput:    Message-stream for 'trace' function.
$S.dataStack:	    Muf-visible data stack.
$S.loopStack:	    Loop stack holding local vars, return addresses &tc.
$S.package:	    Current package.
$S.lib:		    Known packages.
$S.readtable:	    Lisp readtable instance for compiling lisp.
$S.reportEvent:	    Fn invoked to report an event.
$S.actingUser:	    Effective user at the moment.
$S.actualUser:	    Actual user.
$S.group            Currently undefined, intended for shared access.
$S.here:            Current directory in "cd" sense.
$S.jobSet:         Jobset to which this job belongs.
$S.opCount:	    Virtual-instructions-executed count.
$S.parentJob:      Job that forked us off.
$S.priority:	    0 is max execution priority, 2 is min, 1 is normal.
$S.root:            Current logical root, for chroot support.
$S.sleepUntilMillisec:  Earliest time to wake job, when sleeping.
$S.stackBottom:    Logical bottom of stack.  (May differ from real bottom.)
$S.state:           Whether job is running or whatever.
$S.endJob:         In dead jobs, holds value given to 'endJob' prim.
$S.killStandardOutputOnExit: Set $S.standardOutput$S.dead at shutdown?
$S.readNilFromDeadStreams:  Non-NIL => readLine returns NIL.
$S.asynch           Support for ASYNCH package.

Note: For convenience, the $S properties are also available in the public (default) propdir.

Go to the first, previous, next, last section, table of contents.