LispWorks User Guide and Reference Manual > 15 Multiprocessing > 15.2 The process programming interface


15.2.5 Blocking interrupts

The purpose of blocking interrupts is to prevent a process aborting in the middle of an operation that needs to be completed. A typical example is the cleanup forms of an unwind-protect .

Blocking interrupts does not provide atomicity. Other processes may continue to execute.

Blocking interrupts limits the control that LispWorks has over the processes, so interrupts should not be blocked except when necessary. However, apart from blocking interrupts in a process it does not affect the behavior of the system.

The following macros and functions allow control over blocking interrupts: allowing-block-interrupts, with-interrupts-blocked, current-process-unblock-interrupts and current-process-block-interrupts.

Addtionally the macros unwind-protect-blocking-interrupts and unwind-protect-blocking-interrupts-in-cleanups allow your program to prevent interrupts from stopping cleanup forms from completing.

Compatibility note: In LispWorks 5.1 and previous versions, mp:without-preemption and mp:without-interrupts are sometimes used to block interrupts, but they also provide atomicity. In many cases (probably most), they are used to provide atomicity, and in these cases they cannot be replaced by blocking interrupts. To get atomicity in LispWorks 6.0 and later you need to use locks or atomic operations. To get atomicity while debugging, you can also use with-other-threads-disabled.

LispWorks User Guide and Reference Manual - 22 Dec 2009