All Manuals > LispWorks® User Guide and Reference Manual > 42 The MP Package

process-wait Function

Summary

Suspends the current process until a condition is true.

Package

mp

Signature

process-wait wait-reason wait-function &rest wait-arguments

Arguments
wait-reason
A string describing the reason that the process is waiting.
wait-function
A function designator.
wait-arguments
The arguments that wait-function is applied to.
Description

The function process-wait suspends the current Lisp process until the predicate wait-function applied to wait-arguments returns true. This is tested periodically by the scheduler, but in situations where you want more control over the timing you should consider using process-wait-local instead of process-wait and then call process-poke in the process that is expected to cause wait-function to return true.

wait-function has several limitations: it must not do a non-local exit, it should not have side effects and (since it is called frequently) it should be efficient.

Also, wait-function is called with interrupts blocked. It should therefore not allow interrupts, because this could cause deadlocks.

wait-reason allows you to find out why a process is waiting via the function process-whostate.

See also

process-poke
process-wait-local
process-wait-with-timeout
process-whostate
19.6 Process Waiting and communication between processes


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:51