Next: , Previous: , Up: Procedures   [Contents][Index]


7.3.5 Multi-Processing

(require 'process)

This module implements asynchronous (non-polled) time-sliced multi-processing in the SCM Scheme implementation using procedures alarm and alarm-interrupt. Until this is ported to another implementation, consider it an example of writing schedulers in Scheme.

Procedure: add-process! proc

Adds proc, which must be a procedure (or continuation) capable of accepting accepting one argument, to the process:queue. The value returned is unspecified. The argument to proc should be ignored. If proc returns, the process is killed.

Procedure: process:schedule!

Saves the current process on process:queue and runs the next process from process:queue. The value returned is unspecified.

Procedure: kill-process!

Kills the current process and runs the next process from process:queue. If there are no more processes on process:queue, (slib:exit) is called (see System).