MacroPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

without-interrupts

Arguments: &body body

Significant change starting with a 8.1 patch

Starting with a patch released in July, 2009, use of this macro is deprecated and a warning will be signaled when the compiler encounters use of this macro. Because Symmetric Multiprocessing (SMP) will be introduced into Allegro CL 9.0 on some platforms, use of multiprocessing macros without-interrupts and sys:without-scheduling, whose behavior is significantly different in an SMP environment, is deprecated, particularly for those users who intend to use the SMP facility. See smp.htm for full details, but in brief, without-interrupts and sys:without-scheduling effectively provided object locking -- because they prevented process switches, and only one Lisp process could ever run at a time, no object could be modified by another process while code wrapped in the macros was being run. In an SMP Lisp, that is no longer true because processes can run on separate processors simultaneously. Therefore, object locking must be achieved in some other fashion. See smp.htm for links to object locking functionality.

The patch provided all the new functionality for 8.1 and 8.2 although SMP is not yet supported. The purpose it to allow users to make their code ready for SMP. The macro with-delayed-interrupts replaces without-interrupts and on non-SMP Lisps (like Allegro CL 8.1 and 8.2) is essentially just without-interrupts renamed. There is no replacement for sys:without-scheduling.

Uses of without-interrupts and sys:without-scheduling will signal a warning. That warning can be muffled by evaluating (setq excl::*warn-smp-usage* nil).

Even though its use is deprecated, without-interrupts and sys:without-scheduling will continue to exist and work in non-SMP images as they have in earlier releases and currently. Users who do not wish to use SMP can use non-SMP images, which will be available on platforms which support SMP along with SMP images and need not modify their code at all because of the introduction of SMP (beyond suppressing the compiler warning as described above).

This macro executes body, protecting against any handling of asynchronous interrupts. Execution of body is guaranteed to complete without any other process running, or any asynchronous interrupt being dispatched, unless the process does something to block or otherwise explicitly yield to the scheduler (e.g. with mp:process-allow-schedule).

without-interrupts is implemented very efficiently and so may be executed frequently. It is generally bad style to wrap a without-interrupts around a body of code that takes a significant amount of time to execute because that may impose inappropriate high interrupt latency on other (possibly unrelated) interrupt handlers. without-interrupts is intended to be used around short critical sections of code; use of a process-lock may be more appropriate for protecting long bodies of code.

In native threads (:os-threads) implementations of multiprocessing, a lisp process calling a foreign function can release control of the lisp environment so that another lisp process can run. Any attempt to perform such a heap-releasing call within the scope of a without-interrupts block signals an error and does not release the heap. Whether error processing overrides the without-interrupts block depends on the coding of the particular application.

See also without-scheduling and multiprocessing.htm for general information on multiprocessing in Allegro CL.


Copyright (c) 1998-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 9.0. This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version