5.1 About multitasking

5.1.1 Process interaction

A process is a program in execution. For example, a running Lisp image is a single process of the operating system. The Multitasking Facility lets you divide the Lisp process into smaller independent processes that share the same address space. You can create new processes within the Lisp process with the functionmake-process. The predicateprocessp identifies such processes. You can use the following functions to find out information about a process, as described by the function names:

process-initial-arguments 
process-initial-function 
process-interruptions
process-name
process-plist

At any point during its execution, a process is in a particular state, and this state changes as the process runs. The state of a process contains such information as the following:

For the purposes of this discussion, the term "process" refers to a process in the Multitasking Facility; the term "operating system process" refers to processes controlled by the operating system that runs Lisp.

The following functions provide information about the state of a process:

process-active-p 
process-alive-p 
process-in-the-debugger-p 
process-state
process-whostate
show-processes

The Multitasking Facility has a scheduler that uses state information to stop a process and restart it later without changing the results of the execution.

In order to distribute processing time among several processes, the scheduler must suspend one process while another process runs. The scheduler lets each process run for a certain small, fixed period of time, which is called the scheduling quantum. If the process runs for the duration of the scheduling quantum, the scheduler interrupts process execution, saves the state of the process, restores the state of the next available process, and allows that process to run. When all of the active processes have been scheduled, a scheduler cycle is complete.

If there are no processes that need to run, the scheduler informs the operating system to block the Lisp process; that is, it runs the idle process.

The following constructs are used when constructing, manipulating, and scheduling processes:

activate-process 
deactivate-process 
interrupt-process 
kill-process 
make-process 
restart-process 
process-resume-functions
process-suspend-functions
using-initial-io
with-interruptions-allowed
with-interruptions-inhibited
with-scheduling-allowed
with-scheduling-inhibited


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker