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

NextPrevUpTopContentsIndex

process-interrupt

Function
Summary

Interrupts a process.

Package

mp

Signature

process-interrupt process function &rest arguments =>

Arguments

process

A process.

function

A function to apply on resuming process.

arguments

Arguments to supply to function.

Values

None.

Description

The function process-interrupt causes the Lisp process process to apply function to arguments when it is next resumed. Afterwards the process resumes its normal execution, as long as function does not throw. A waiting process is temporarily woken up.

Notes

Interrupts should be used only for simple operations such as setting a variable. Any more complex interrupt function is potentially dangerous and should be avoided. The problem is that even simple code like:

  (let ((message (read-message)))
    (process-message message))

may lose the message if an interrupt ends up throwing between the two lines. In addition, the code in the interrupt may be executed while some tree of pointers is in an inconsistent state (while the message is incompletely processed, for example).

See also

process-interrupt-list


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex