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

NextPrevUpTopContentsIndex

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.

Values

None.

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 make the wait-function 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
Process Waiting and communication between processes


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex