Page:Scheme - An interpreter for extended lambda calculus.djvu/38



We now come to the multiprocess primitives.

temporarily creates a new set of machine registers (by the lambda-binding mechanism of the host language), establishes the new process in those registers, swaps it out, and returns the new process id; returning causes the old machine registers to be restored.

is an internal microcode routine which terminates the current process. If the current process is the only one, then all processes have been stopped, and so a new SCHEME top level is created; otherwise  pulls the next process off the scheduler queue and swaps it in. Note that we cannot use  because a   will happen in   as soon as   completes (this is a very deep global property of the interpreter, and a fine