5.1 About multitasking
deactivate-process; the function
activate-processmakes an inactive process active again.
process-wait-with-timeoutto associate a wait function with a process. You can also create a process in a waiting state by using the
:wait-functionoption to the function
make-process. The function
process-wait-functionreturns the wait function of a process, and the function
process-wait-argumentsreturns its arguments.
Every process has a priority. Active processes are kept on a queue that is sorted by priority. Processes with higher priority appear at the front of the queue.
The scheduler simulates concurrent execution of processes by periodically passing control from one process to another. It examines each process in order of priority and takes the appropriate action:
nilvalue, the process becomes runnable, its wait function is discarded, and the scheduler immediately passes control to it. No other wait functions are evaluated.
nil, the scheduler examines the next process.
The wait function is evaluated in the dynamic context of the process that is current when the scheduler is entered. Scheduling is inhibited while the wait function runs to prevent recursive invocations of the scheduler. If the wait function fails to terminate when the scheduler invokes it, Lisp will hang.
The scheduler is called automatically at the end of the scheduling quantum, or you can invoke it with the following functions:
process-allow-schedulesimply starts the scheduler.
process-wait-with-timeoutassociate a wait function with a process, mark the current process as waiting, and call the scheduler.
Generated with Harlequin WebMaker